conv_bal
watcha.h@almacom.co.th 2015-01-14 11:31:24 +07:00
parent efdc122b03
commit 7eda2f6369
5 changed files with 12 additions and 13 deletions

View File

@ -8,7 +8,7 @@
</head>
<group form_layout="stacked" attrs='{"readonly":[["state","=","completed"]]}'>
<field name="number" span="2"/>
<field name="sickbed_id" attrs='{"readonly":[["state","in",["completed","waiting_payment","paid","cancelled"]]]}' domain="[['state','=','available']]" required="1" span="2"/>
<field name="sickbed_id" string="Sickbed (Available)" attrs='{"readonly":[["state","in",["completed","waiting_payment","paid","cancelled"]]]}' domain="[['state','=','available']]" required="1" span="2"/>
<field name="patient_id" span="2" onchange="onchange_patient"/>
<field name="patient_type_id" span="2"/>
<field name="cycle_id" span="2" required="1" onchange="onchange_cycle"/>

View File

@ -79,14 +79,7 @@
<field name="note"/>
</list>
</field>
<field name="hd_case_staffs">
<list>
<field name="hd_case_id"/>
</list>
<form>
<field name="hd_case_id"/>
</form>
</field>
<field name="hd_cases"/>
<field name="cycle_item_nurses">
<list>
<field name="cycle_item_id"/>

View File

@ -69,7 +69,7 @@ class HDCase(Model):
_fields={
"number": fields.Char("Number",required=True,search=True),
'sickbed_id': fields.Many2One("clinic.sickbed",'Sickbed (Available)'),
'sickbed_id': fields.Many2One("clinic.sickbed",'Sickbed'),
"ref": fields.Char("Ref",search=True),
"time_start": fields.DateTime("Start Time",required=True,search=True),
"time_stop": fields.DateTime("Finish Time",required=True,search=True),

View File

@ -1,10 +1,10 @@
from netforce.model import Model, fields
class HdCaseStaff(Model):
class HDCaseStaff(Model):
_name="clinic.hd.case.staff"
_name_field="staff_id"
_fields={
"hd_case_id": fields.Many2One("clinic.hd.case","HdCase",required=True,on_delete="cascade"),
"hd_case_id": fields.Many2One("clinic.hd.case","HD Case",required=True,on_delete="cascade"),
"staff_id": fields.Many2One("clinic.staff","Doctor",search=True),
"type": fields.Selection([("doctor","Doctor"),('nurse','Nurse'),("staff","Staff")],"Type",required=True),
"priop": fields.Selection([("owner","Owner"),('second','Secondary'),('other','Other')],"Priority"),
@ -16,5 +16,5 @@ class HdCaseStaff(Model):
'priop': 'second',
}
HdCaseStaff.register()
HDCaseStaff.register()

View File

@ -54,6 +54,11 @@ class Staff(Model):
}
return res
def _get_hdcase(self,ids,context={}):
res={}
for obj in self.browse(ids):
res[obj.id]=[1]
return res
_fields={
'employee_id': fields.Many2One("hr.employee","Employee"),
@ -101,6 +106,7 @@ class Staff(Model):
'cycle_id': fields.Many2One('clinic.cycle','Last Cycle',function="_get_cycle"),
'branch_id': fields.Many2One("clinic.branch","Branch"),
"hd_case_staffs": fields.One2Many("clinic.hd.case.staff","staff_id","HD Cases"),
"hd_cases": fields.Many2Many("clinic.hd.case","HD Cases",function="_get_hdcase"),
"cycle_item_nurses": fields.One2Many("clinic.cycle.item.nurse","nurse_id","Cycle Items"),
}