conv_bal
watcha.h@almacom.co.th 2015-01-14 10:55:08 +07:00
parent 6ea0dd1d2b
commit efdc122b03
5 changed files with 24 additions and 11 deletions

View File

@ -17,8 +17,7 @@
<field name="visit_id" span="2"/>
<field name="branch_id" span="2"/>
<field name="req_fee" span="2" invisible="1"/>
<!-- enable show_company=1 -->
<field name="company_id" span="2" invisible="1"/>
<field name="company_id" span="2" invisible="1"/> <!-- to show company name, don't remove -->
<field name="hct_include" span="2" invisible="1"/>
</group>
<tabs>

View File

@ -1,5 +1,6 @@
<form model="clinic.sickbed" show_company="1">
<head>
<field name="state"/>
<button string="Options" dropdown="1">
<item string="Copy" method="copy"/>
</button>

View File

@ -3,6 +3,7 @@
<field name="date"/>
<field name="patient_id"/>
<field name="image" preview="1"/>
<!--<field name="available"/>-->
<!--<field name="sequence"/>-->
<field name="note"/>
<field name="state"/>
</list>

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'),
'sickbed_id': fields.Many2One("clinic.sickbed",'Sickbed (Available)'),
"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),
@ -110,7 +110,7 @@ class HDCase(Model):
'note': fields.Text("Note"),
'complication': fields.Text("Complication"),
"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_date': fields.Date("Pay Date"),
'pay_account_id': fields.Many2One("account.account","Account"),
@ -163,6 +163,7 @@ class HDCase(Model):
'invoice_option': 'fee',
'invoice_policy': 'fee',
'req_fee': 0,
'hct_include': False,
}
_order="date desc,number desc"
@ -212,14 +213,18 @@ class HDCase(Model):
branch=patient.branch_id
cycle=patient.cycle_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:
data['fee_partner_id']=partner.id
else:
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']=[]
doctor=patient.doctor_id
data['staffs']=[] # XXX
@ -1066,5 +1071,4 @@ class HDCase(Model):
}
HDCase.register()

View File

@ -31,7 +31,7 @@ class SickBed(Model):
'company_id': fields.Many2One("company","Company"),
'patient_id': fields.Many2One("clinic.patient","Lasted Patient",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"),
'sequence': fields.Integer("Sequence"),
'note': fields.Text("Note"),
@ -60,4 +60,12 @@ class SickBed(Model):
'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()