update dialyzer from hd case
parent
10b2578088
commit
d5e1a43966
|
@ -3,6 +3,7 @@
|
|||
<field name="state"/>
|
||||
<button string="Options" dropdown="1">
|
||||
<item string="Copy" method="copy"/>
|
||||
<item string="To Draft" method="to_draft" states="active"/>
|
||||
</button>
|
||||
</head>
|
||||
<group span="6" columns="1">
|
||||
|
@ -12,7 +13,7 @@
|
|||
<field name="department_id" required="1"/>
|
||||
<field name="date"/>
|
||||
<field name="exp_date"/>
|
||||
<field name="membrane_type"/>
|
||||
<field name="membrane_type" required="1"/>
|
||||
</group>
|
||||
<group span="6" columns="1">
|
||||
<field name="product_id" onchange="onchange_product"/>
|
||||
|
@ -31,9 +32,8 @@
|
|||
<!--<separator string="Note: 'Use time' will count automatic after finish HD Case."/>-->
|
||||
</group>
|
||||
<foot>
|
||||
<button string="Confirm" type="success" states="new" method="confirm"/>
|
||||
<button string="Validate" type="success" states="new" method="validate"/>
|
||||
<button string="Drop" type="danger" icon="remove" states="active" method="drop"/>
|
||||
<button string="Renew" type="primary" icon="refresh" states="active" method="renew"/>
|
||||
</foot>
|
||||
<related>
|
||||
<field name="pickings" click_action="view_picking"/>
|
||||
|
|
|
@ -95,7 +95,7 @@ class Dialyzer(Model):
|
|||
obj=self.browse(ids)[0]
|
||||
obj.write({"state":"voided"})
|
||||
|
||||
def confirm(self,ids,context={}):
|
||||
def validate(self,ids,context={}):
|
||||
id=ids[0]
|
||||
obj=self.browse(id)
|
||||
patient=obj.patient_id
|
||||
|
@ -211,11 +211,10 @@ class Dialyzer(Model):
|
|||
'flash': 'Dializer %s is cancelled'%(obj.number),
|
||||
}
|
||||
|
||||
def renew(self,ids,context={}):
|
||||
def to_draft(self,ids,context={}):
|
||||
obj=self.browse(ids[0])
|
||||
# XXX
|
||||
if obj.use_time > obj.max_use_time:
|
||||
raise Exception("Dialyzer %s is expired. (use time > max use time)"%obj.number or '')
|
||||
#if obj.use_time > obj.max_use_time:
|
||||
#raise Exception("Dialyzer %s is expired. (use time > max use time)"%obj.number or '')
|
||||
obj.cancel()
|
||||
obj.write({"state": "new"})
|
||||
|
||||
|
|
|
@ -108,9 +108,10 @@ class ClinicSetting(Model):
|
|||
if user_id !=1:
|
||||
print("Only admin!!")
|
||||
return
|
||||
for pt in get_model("clinic.patient").search_browse([]):
|
||||
pt.write({
|
||||
'hn_no': pt.number or "",
|
||||
for hdi in get_model("clinic.hd.case.dialyzer").search_browse([]):
|
||||
dlz=hdi.dialyzer_id
|
||||
hdi.write({
|
||||
'membrane_type': dlz.membrane_type,
|
||||
})
|
||||
print("Done! ")
|
||||
|
||||
|
|
Loading…
Reference in New Issue