From ef7eeeda2830868820ea80e828a08a42a5214ebd Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Tue, 18 Aug 2015 17:22:48 +0700 Subject: [PATCH 1/2] todo --- netforce_clinic/models/hd_case.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index de83494..2c50580 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -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 From 9b1331443f18dd870a8454379e1abc5cf982b20b Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Tue, 18 Aug 2015 18:18:12 +0700 Subject: [PATCH 2/2] show dialyzer history --- netforce_clinic/layouts/clinic_dialyzer_form.xml | 16 +++++++++++++++- netforce_clinic/models/dialyzer.py | 3 ++- netforce_clinic/models/hd_case_dialyzer.py | 9 ++++++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/netforce_clinic/layouts/clinic_dialyzer_form.xml b/netforce_clinic/layouts/clinic_dialyzer_form.xml index 419d626..aea4907 100644 --- a/netforce_clinic/layouts/clinic_dialyzer_form.xml +++ b/netforce_clinic/layouts/clinic_dialyzer_form.xml @@ -35,7 +35,21 @@