todo
parent
68b6fec847
commit
ef7eeeda28
|
@ -870,14 +870,17 @@ class HDCase(Model):
|
|||
for obj in self.browse(ids):
|
||||
is_decrease=context.get('is_decrease')
|
||||
for dlz_line in obj.dialyzers:
|
||||
dlz=dlz_line.dialyzer_id
|
||||
membrane_type=dlz_line.membrane_type or 'unsub'
|
||||
dialyzer_type=dlz_line.dialyzer_type or 'low'
|
||||
use_time=dlz_line.use_time or 0
|
||||
max_use_time=dlz_line.max_use_time or 0
|
||||
desc=dlz_line.description or ''
|
||||
#TODO when we to draft after approve hdcase it will update the wrong use time
|
||||
#if use_time > (dlz.use_time or 0):
|
||||
#continue
|
||||
if is_decrease:
|
||||
use_time-=1
|
||||
print("decrease ok")
|
||||
vals={
|
||||
'membrane_type': membrane_type,
|
||||
'dialyzer_type': dialyzer_type,
|
||||
|
@ -892,9 +895,6 @@ class HDCase(Model):
|
|||
})
|
||||
elif use_time > max_use_time:
|
||||
raise Exception("Dialyzer is expired!")
|
||||
else:
|
||||
pass
|
||||
dlz=dlz_line.dialyzer_id
|
||||
dlz.write(vals)
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in New Issue