improve
parent
6ea0dd1d2b
commit
efdc122b03
|
@ -17,8 +17,7 @@
|
||||||
<field name="visit_id" span="2"/>
|
<field name="visit_id" span="2"/>
|
||||||
<field name="branch_id" span="2"/>
|
<field name="branch_id" span="2"/>
|
||||||
<field name="req_fee" span="2" invisible="1"/>
|
<field name="req_fee" span="2" invisible="1"/>
|
||||||
<!-- enable show_company=1 -->
|
<field name="company_id" span="2" invisible="1"/> <!-- to show company name, don't remove -->
|
||||||
<field name="company_id" span="2" invisible="1"/>
|
|
||||||
<field name="hct_include" span="2" invisible="1"/>
|
<field name="hct_include" span="2" invisible="1"/>
|
||||||
</group>
|
</group>
|
||||||
<tabs>
|
<tabs>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<form model="clinic.sickbed" show_company="1">
|
<form model="clinic.sickbed" show_company="1">
|
||||||
<head>
|
<head>
|
||||||
|
<field name="state"/>
|
||||||
<button string="Options" dropdown="1">
|
<button string="Options" dropdown="1">
|
||||||
<item string="Copy" method="copy"/>
|
<item string="Copy" method="copy"/>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<field name="date"/>
|
<field name="date"/>
|
||||||
<field name="patient_id"/>
|
<field name="patient_id"/>
|
||||||
<field name="image" preview="1"/>
|
<field name="image" preview="1"/>
|
||||||
<!--<field name="available"/>-->
|
<!--<field name="sequence"/>-->
|
||||||
|
<field name="note"/>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
</list>
|
</list>
|
||||||
|
|
|
@ -69,7 +69,7 @@ class HDCase(Model):
|
||||||
|
|
||||||
_fields={
|
_fields={
|
||||||
"number": fields.Char("Number",required=True,search=True),
|
"number": fields.Char("Number",required=True,search=True),
|
||||||
'sickbed_id': fields.Many2One("clinic.sickbed",'Sickbed'),
|
'sickbed_id': fields.Many2One("clinic.sickbed",'Sickbed (Available)'),
|
||||||
"ref": fields.Char("Ref",search=True),
|
"ref": fields.Char("Ref",search=True),
|
||||||
"time_start": fields.DateTime("Start Time",required=True,search=True),
|
"time_start": fields.DateTime("Start Time",required=True,search=True),
|
||||||
"time_stop": fields.DateTime("Finish Time",required=True,search=True),
|
"time_stop": fields.DateTime("Finish Time",required=True,search=True),
|
||||||
|
@ -110,7 +110,7 @@ class HDCase(Model):
|
||||||
'note': fields.Text("Note"),
|
'note': fields.Text("Note"),
|
||||||
'complication': fields.Text("Complication"),
|
'complication': fields.Text("Complication"),
|
||||||
"cycle_id": fields.Many2One("clinic.cycle","Cycle"),
|
"cycle_id": fields.Many2One("clinic.cycle","Cycle"),
|
||||||
'cycle_item_id': fields.Many2One("clinic.cycle.item","Cycle Item (Team)"), # on_delete="cascade" -> will rm visit from cycle item
|
'cycle_item_id': fields.Many2One("clinic.cycle.item","Cycle Item (Nurses)"), # on_delete="cascade" -> will rm visit from cycle item
|
||||||
'pay_amount': fields.Float("Amount",function="_get_pay_amount"),
|
'pay_amount': fields.Float("Amount",function="_get_pay_amount"),
|
||||||
'pay_date': fields.Date("Pay Date"),
|
'pay_date': fields.Date("Pay Date"),
|
||||||
'pay_account_id': fields.Many2One("account.account","Account"),
|
'pay_account_id': fields.Many2One("account.account","Account"),
|
||||||
|
@ -163,6 +163,7 @@ class HDCase(Model):
|
||||||
'invoice_option': 'fee',
|
'invoice_option': 'fee',
|
||||||
'invoice_policy': 'fee',
|
'invoice_policy': 'fee',
|
||||||
'req_fee': 0,
|
'req_fee': 0,
|
||||||
|
'hct_include': False,
|
||||||
}
|
}
|
||||||
_order="date desc,number desc"
|
_order="date desc,number desc"
|
||||||
|
|
||||||
|
@ -212,14 +213,18 @@ class HDCase(Model):
|
||||||
branch=patient.branch_id
|
branch=patient.branch_id
|
||||||
cycle=patient.cycle_id
|
cycle=patient.cycle_id
|
||||||
partner=patient.type_id.contact_id
|
partner=patient.type_id.contact_id
|
||||||
data['department_id']=department.id
|
|
||||||
data['branch_id']=branch.id
|
|
||||||
data['cycle_id']=cycle.id
|
|
||||||
data['patient_type_id']=patient.type_id.id
|
|
||||||
if partner:
|
if partner:
|
||||||
data['fee_partner_id']=partner.id
|
data['fee_partner_id']=partner.id
|
||||||
else:
|
else:
|
||||||
data['fee_partner_id']=None
|
data['fee_partner_id']=None
|
||||||
|
data['department_id']=department.id
|
||||||
|
data['branch_id']=branch.id
|
||||||
|
data['cycle_id']=cycle.id
|
||||||
|
data['patient_type_id']=patient.type_id.id
|
||||||
|
if patient.type_id.hct_include:
|
||||||
|
data['hct_include']=True
|
||||||
|
else:
|
||||||
|
data['hct_include']=False
|
||||||
data['dialyzers']=[]
|
data['dialyzers']=[]
|
||||||
doctor=patient.doctor_id
|
doctor=patient.doctor_id
|
||||||
data['staffs']=[] # XXX
|
data['staffs']=[] # XXX
|
||||||
|
@ -1066,5 +1071,4 @@ class HDCase(Model):
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HDCase.register()
|
HDCase.register()
|
||||||
|
|
|
@ -31,7 +31,7 @@ class SickBed(Model):
|
||||||
'company_id': fields.Many2One("company","Company"),
|
'company_id': fields.Many2One("company","Company"),
|
||||||
'patient_id': fields.Many2One("clinic.patient","Lasted Patient",function="_get_all",function_multi=True),
|
'patient_id': fields.Many2One("clinic.patient","Lasted Patient",function="_get_all",function_multi=True),
|
||||||
'image': fields.File("Image",function="_get_all",function_multi=True),
|
'image': fields.File("Image",function="_get_all",function_multi=True),
|
||||||
'date': fields.Date("Date",function="_get_all",function_multi=True),
|
'date': fields.Date("Lasted Date",function="_get_all",function_multi=True),
|
||||||
"state": fields.Selection([("available","Available"),("not_available","Not Available")],"Status"),
|
"state": fields.Selection([("available","Available"),("not_available","Not Available")],"Status"),
|
||||||
'sequence': fields.Integer("Sequence"),
|
'sequence': fields.Integer("Sequence"),
|
||||||
'note': fields.Text("Note"),
|
'note': fields.Text("Note"),
|
||||||
|
@ -60,4 +60,12 @@ class SickBed(Model):
|
||||||
'flash': 'Copy succesfully',
|
'flash': 'Copy succesfully',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def write(self,ids,vals,**kw):
|
||||||
|
if 'available' in vals.keys():
|
||||||
|
if vals['available']:
|
||||||
|
vals['state']='available'
|
||||||
|
else:
|
||||||
|
vals['state']='not_available'
|
||||||
|
super().write(ids,vals,**kw)
|
||||||
|
|
||||||
SickBed.register()
|
SickBed.register()
|
||||||
|
|
Loading…
Reference in New Issue