fix_acc
watcha.h 2015-08-18 17:22:48 +07:00
parent 68b6fec847
commit ef7eeeda28
1 changed files with 4 additions and 4 deletions

View File

@ -870,14 +870,17 @@ class HDCase(Model):
for obj in self.browse(ids): for obj in self.browse(ids):
is_decrease=context.get('is_decrease') is_decrease=context.get('is_decrease')
for dlz_line in obj.dialyzers: for dlz_line in obj.dialyzers:
dlz=dlz_line.dialyzer_id
membrane_type=dlz_line.membrane_type or 'unsub' membrane_type=dlz_line.membrane_type or 'unsub'
dialyzer_type=dlz_line.dialyzer_type or 'low' dialyzer_type=dlz_line.dialyzer_type or 'low'
use_time=dlz_line.use_time or 0 use_time=dlz_line.use_time or 0
max_use_time=dlz_line.max_use_time or 0 max_use_time=dlz_line.max_use_time or 0
desc=dlz_line.description or '' 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: if is_decrease:
use_time-=1 use_time-=1
print("decrease ok")
vals={ vals={
'membrane_type': membrane_type, 'membrane_type': membrane_type,
'dialyzer_type': dialyzer_type, 'dialyzer_type': dialyzer_type,
@ -892,9 +895,6 @@ class HDCase(Model):
}) })
elif use_time > max_use_time: elif use_time > max_use_time:
raise Exception("Dialyzer is expired!") raise Exception("Dialyzer is expired!")
else:
pass
dlz=dlz_line.dialyzer_id
dlz.write(vals) dlz.write(vals)
return True return True