xxxx
parent
5dab76ee4f
commit
69406b16b4
|
@ -14,7 +14,7 @@
|
|||
<tab string="HDCase">
|
||||
<field name="hd_cases" nolabel="1" count="5">
|
||||
<list model="clinic.hd.case" colors='{"#cfc":[["state","=","completed"]],"#f9e37d":[["state","=","in_progress"]],"#bcbbb9":[["state","=","cancelled"]],"#ACD1E9":[["state","=","waiting_payment"]],"#70DB93":[["state","=","paid"]]}'>
|
||||
<field name="sickbed_id" domain="[['available','=',True]]" span="2"/>
|
||||
<field name="sickbed_id" domain="[['available','=',true]]" span="2"/>
|
||||
<field name="patient_id" span="2"/>
|
||||
<field name="time_start" span="2"/>
|
||||
<field name="wt_start" span="2"/>
|
||||
|
@ -38,15 +38,13 @@
|
|||
</list>
|
||||
</field>
|
||||
</tab>
|
||||
<tab string="Others">
|
||||
</tab>
|
||||
<tab string="Validation">
|
||||
<field name="user_id" span="3"/>
|
||||
<button string="Validate" type="success" method="validate" icon="ok" size="small" states="draft" />
|
||||
</tab>
|
||||
</tabs>
|
||||
<related>
|
||||
<field name="visits"/>
|
||||
<!--<field name="visits"/>-->
|
||||
<field name="comments"/>
|
||||
</related>
|
||||
</form>
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
</head>
|
||||
<group form_layout="stacked">
|
||||
<field name="number" span="2"/>
|
||||
<field name="sickbed_id" domain="[['available','=',True]]" span="2"/>
|
||||
<field name="sickbed_id" domain="[['available','=',true]]" 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"/>
|
||||
<field name="department_id" span="2"/>
|
||||
<field name="visit_id" span="2"/>
|
||||
<field name="cycle_item_id" span="2" domain="[['cycle_id','=',cycle_id]]"/>
|
||||
<field name="visit_id" span="2"/>
|
||||
<field name="req_fee" span="2" readonly="1" invisible="1"/>
|
||||
</group>
|
||||
<tabs>
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
</button>
|
||||
</head>
|
||||
<field name="name"/>
|
||||
<field name="available"/>
|
||||
<field name="available" readonly="1"/>
|
||||
</form>
|
||||
|
|
|
@ -73,6 +73,7 @@ class CycleItem(Model):
|
|||
|
||||
|
||||
def create(self, vals,**kw):
|
||||
print('kw ', kw)
|
||||
new_id=super().create(vals,**kw)
|
||||
self.function_store([new_id])
|
||||
return new_id
|
||||
|
|
|
@ -71,7 +71,6 @@ class Dialyzer(Model):
|
|||
"company_id": lambda *a: get_active_company(),
|
||||
'product_id': _get_product,
|
||||
'dialyzer_type': 'low',
|
||||
'member_type': 'unsub',
|
||||
}
|
||||
_order="date desc,number desc"
|
||||
|
||||
|
@ -94,7 +93,8 @@ class Dialyzer(Model):
|
|||
ship_address_id=address.id
|
||||
break
|
||||
if not ship_address_id:
|
||||
raise Exception("contact %s dont'have address with type shipping"%partner.name)
|
||||
patient.simple_address()
|
||||
#raise Exception("contact %s dont'have address with type shipping"%partner.name)
|
||||
st=get_model("clinic.setting").browse(1)
|
||||
journal=st.stock_journal_id
|
||||
if not journal:
|
||||
|
|
|
@ -150,7 +150,8 @@ class HDCase(Model):
|
|||
"date": lambda *a: time.strftime("%Y-%m-%d"),
|
||||
"time_start": lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
|
||||
"time_stop": lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
|
||||
"number": _get_number,
|
||||
#"number": _get_number,
|
||||
'number': '/',
|
||||
"company_id": lambda *a: get_active_company(),
|
||||
'wt_start': 0.0,
|
||||
'wt_stop': 0.0,
|
||||
|
@ -497,7 +498,8 @@ class HDCase(Model):
|
|||
if not obj.lines:
|
||||
return
|
||||
|
||||
partner=obj.patient_id.partner_id
|
||||
patient=obj.patient_id
|
||||
partner=patient.partner_id
|
||||
if not partner:
|
||||
raise Exception("Contact not for this patient")
|
||||
ship_address_id=None
|
||||
|
@ -506,7 +508,8 @@ class HDCase(Model):
|
|||
ship_address_id=address.id
|
||||
break
|
||||
if not ship_address_id:
|
||||
raise Exception("contact %s dont'have address with type shipping"%partner.name)
|
||||
patient.simple_address()
|
||||
#raise Exception("contact %s dont'have address with type shipping"%partner.name)
|
||||
pick_vals={
|
||||
"type": "out",
|
||||
"ref": obj.number,
|
||||
|
@ -562,12 +565,17 @@ class HDCase(Model):
|
|||
#TODO should find dlz when confirm visit
|
||||
if not obj.dialyzers:
|
||||
raise Exception("Please input dialyzer!")
|
||||
obj.sickbed_id.write({
|
||||
sickbed=obj.sickbed_id
|
||||
sickbed.write({
|
||||
'available': False,
|
||||
})
|
||||
|
||||
vals={
|
||||
'state': 'in_progress',
|
||||
}
|
||||
if obj.number=='/':
|
||||
number=self._get_number()
|
||||
vals['number']=number
|
||||
|
||||
# update start time
|
||||
st=get_model("clinic.setting").browse(1)
|
||||
|
|
Loading…
Reference in New Issue