improve
parent
7cb1e14c09
commit
251ca4a592
|
@ -36,14 +36,13 @@
|
|||
<field name="hd_acc" span="2"/>
|
||||
<field name="date" invisible="1" span="2"/>
|
||||
<newline/>
|
||||
<field name="wt_start" span="2" attrs='{"required":[["state","=","waiting_treatment"]]}'/>
|
||||
<field name="wt_stop" span="2"/>
|
||||
<field name="wt_start" onchange="onchange_weight" attrs='{"required":[["state","=","waiting_treatment"]]}' span="2"/>
|
||||
<field name="wt_stop" onchange="onchange_weight" span="2"/>
|
||||
<field name="hct" span="2" onchange="onchange_hct" attrs='{"invisible":[["hct_include","=",false]],"required": [["hct_include","=", true]]}'/>
|
||||
<field name="hct_msg" span="4" readonly="1" attrs='{"invisible":[["hct_include","=",false]]}'/>
|
||||
<newline/>
|
||||
<field name="bp_start" span="2"/>
|
||||
<field name="bp_stop" span="2"/>
|
||||
<!--<field name="membrane_type" span="2" />-->
|
||||
<field name="bid_flow_rate" span="2"/>
|
||||
<field name="ultrafittration" span="2"/>
|
||||
<field name="dialyzers" nolabel="1" attrs='{"readonly":[["state","=","completed"]]}'>
|
||||
|
|
|
@ -460,6 +460,9 @@ class HDCase(Model):
|
|||
|
||||
def cancelled(self,ids,context={}):
|
||||
obj=self.browse(ids)[0]
|
||||
obj.sickbed_id.write({
|
||||
'available': True,
|
||||
})
|
||||
obj.write({"state":"cancelled"})
|
||||
|
||||
def make_invoices(self,ids,context={}):
|
||||
|
@ -912,6 +915,10 @@ class HDCase(Model):
|
|||
obj.write({
|
||||
'state': state,
|
||||
})
|
||||
# update sickbed
|
||||
obj.sickbed_id.write({
|
||||
'available': False,
|
||||
})
|
||||
|
||||
return {
|
||||
'next': {
|
||||
|
@ -967,7 +974,7 @@ class HDCase(Model):
|
|||
'nurse_id': nurse_id,
|
||||
})
|
||||
obj.sickbed_id.write({
|
||||
'state': 'available',
|
||||
'available': True,
|
||||
})
|
||||
set_active_user(user_id)
|
||||
return {
|
||||
|
@ -1383,7 +1390,7 @@ class HDCase(Model):
|
|||
if vals['sickbed_id']!=obj.sickbed_id.id and obj.state!='draft':
|
||||
if obj.sickbed_id:
|
||||
obj.sickbed_id.write({
|
||||
'state': 'available',
|
||||
'available': True,
|
||||
})
|
||||
sb=get_model("clinic.sickbed").browse(vals['sickbed_id'])
|
||||
sb.write({
|
||||
|
@ -1429,6 +1436,13 @@ class HDCase(Model):
|
|||
data['duration']=cycle.duration
|
||||
return data
|
||||
|
||||
def onchange_weight(self,context={}):
|
||||
data=context['data']
|
||||
wt_stop=data['wt_stop'] or 0
|
||||
wt_start=data['wt_start'] or 0
|
||||
data['ultrafittration']=wt_stop-wt_start
|
||||
return data
|
||||
|
||||
def new_shop(self,ids,context={}):
|
||||
return {
|
||||
'next': {
|
||||
|
|
|
@ -53,7 +53,9 @@ class HDCasePopupDiscontinue(Model):
|
|||
'note': obj.note,
|
||||
'state': 'cancelled',
|
||||
})
|
||||
|
||||
hd_case.sickbed_id.write({
|
||||
'available': True,
|
||||
})
|
||||
prod_ids=[]
|
||||
for line in obj.lines:
|
||||
prod=line.product_id
|
||||
|
|
Loading…
Reference in New Issue