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