conv_bal
watcha.h 2014-10-16 00:12:03 +07:00
parent 07a019c7f4
commit 3201f414c2
14 changed files with 35 additions and 35 deletions

View File

@ -1,6 +0,0 @@
<action>
<field name="string">Nationalities</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.round</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -1,6 +0,0 @@
<action>
<field name="type">report_odt</field>
<field name="model">clinic.round.report</field>
<field name="method">get_data</field>
<field name="template">round</field>
</action>

View File

@ -1,6 +0,0 @@
<action>
<field name="string">Schedule</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.schedule</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -1,6 +0,0 @@
<action>
<field name="type">report_odt</field>
<field name="model">clinic.round</field>
<field name="method">get_data</field>
<field name="template">round</field>
</action>

View File

@ -7,7 +7,6 @@
<item string="Patients"> <item string="Patients">
<item string="Patients" action="clinic_patient"/> <item string="Patients" action="clinic_patient"/>
<item string="Dialyzers" action="clinic_dialyzer"/> <item string="Dialyzers" action="clinic_dialyzer"/>
<!--<item string="Schedules" action="clinic_schedule"/>-->
<divider/> <divider/>
<header string="OTHERS"/> <header string="OTHERS"/>
<item string="Races" action="clinic_race"/> <item string="Races" action="clinic_race"/>

View File

@ -1,4 +0,0 @@
<form model="clinic.schedule">
<field name="name"/>
<field name="code"/>
</form>

View File

@ -1,4 +0,0 @@
<list model="clinic.schedule">
<field name="name"/>
<field name="code"/>
</list>

View File

@ -1,6 +1,7 @@
<form model="clinic.visit" attrs='{"readonly":[["state","in",["confirmed"]]]}' show_company="1"> <form model="clinic.visit" attrs='{"readonly":[["state","in",["confirmed"]]]}' show_company="1">
<head> <head>
<field name="state"/> <field name="state"/>
<button string="Gen No." icon="check" type="primary" method="gen_no"/>
<button string="Print" icon="print" action="report_visit_form"/> <button string="Print" icon="print" action="report_visit_form"/>
<button string="Options" dropdown="1"> <button string="Options" dropdown="1">
<item string="Copy" method="copy"/> <item string="Copy" method="copy"/>

View File

@ -1,6 +1,8 @@
<list model="clinic.visit"> <list model="clinic.visit">
<search> <search>
<field name="number"/> <field name="number"/>
<field name="time_start"/>
<field name="time_stop"/>
<field name="cycle_id"/> <field name="cycle_id"/>
<field name="patient_id"/> <field name="patient_id"/>
<field name="doctor_id"/> <field name="doctor_id"/>

View File

@ -3,7 +3,6 @@ from datetime import datetime, timedelta
from netforce.model import Model, fields, get_model from netforce.model import Model, fields, get_model
from netforce.access import get_active_company, get_active_user, set_active_user from netforce.access import get_active_company, get_active_user, set_active_user
#from netforce.utils import get_data_path
FMT_DATE="%Y-%m-%d %H:%M:%S" FMT_DATE="%Y-%m-%d %H:%M:%S"
@ -14,6 +13,18 @@ class Visit(Model):
_name_field="number" _name_field="number"
_multi_company=True _multi_company=True
def _get_visit_date(self,ids,context):
res={}
for obj in self.browse(ids):
res[obj.id]=obj.time_start[0:10]
return res
def _get_print_date(self,ids,context={}):
res={}
for obj in self.browse(ids):
res[obj.id]=datetime.now().strftime("%Y-%m-%d %H:%M:%S")
return res
_fields={ _fields={
"number": fields.Char("Number",required=True,search=True), "number": fields.Char("Number",required=True,search=True),
"time_start": fields.DateTime("Time Start",required=True), "time_start": fields.DateTime("Time Start",required=True),
@ -28,9 +39,11 @@ class Visit(Model):
"cycle_id": fields.Many2One("clinic.cycle","Cycle"), "cycle_id": fields.Many2One("clinic.cycle","Cycle"),
"state": fields.Selection([["draft","Draft"],["confirmed","Confirmed"],["cancelled","Cancelled"]],"Status",required=True), "state": fields.Selection([["draft","Draft"],["confirmed","Confirmed"],["cancelled","Cancelled"]],"Status",required=True),
"comments": fields.One2Many("message","related_id","Comments"), "comments": fields.One2Many("message","related_id","Comments"),
'visit_date': fields.Date('Visit Date',function="_get_visit_date"),
'print_date': fields.Date('Print Date',function="_get_print_date"),
} }
def _get_number( self,context={}): def _get_number(self,context={}):
while 1: while 1:
seq_name='Clinic Visit' seq_name='Clinic Visit'
seq_id=get_model("sequence").find_sequence(name=seq_name) seq_id=get_model("sequence").find_sequence(name=seq_name)
@ -248,4 +261,21 @@ class Visit(Model):
'state': 'draft', 'state': 'draft',
}) })
def gen_no(self,ids,context={}):
obj=self.browse(ids)[0]
if obj.number != '/':
return
number=self._get_number(context)
obj.write({
'number': number,
})
return {
'next': {
'name': 'clinic_visit',
'mode': 'form',
'active_id': obj.id,
},
'flash': 'Gen No OK',
}
Visit.register() Visit.register()

Binary file not shown.

Binary file not shown.