diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index 49d418f..02b86fc 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -1412,6 +1412,11 @@ class HDCase(Model): 'state': 'not_available', }) set_active_user(user_id) + if 'lines' in vals.keys(): + if not vals['lines']: + print("lines is empty will update it now...") + patient_id=obj.patient_id.id + vals=self.get_staff_line(vals,patient_id) self.function_store(ids) super().write(ids,vals,**kw) obj=self.browse(ids)[0] diff --git a/netforce_clinic/models/visit.py b/netforce_clinic/models/visit.py index 391adce..6e10816 100644 --- a/netforce_clinic/models/visit.py +++ b/netforce_clinic/models/visit.py @@ -186,7 +186,7 @@ class Visit(Model): } st=get_model("clinic.setting").browse(1) - if st.find_dlz: + if st.find_dlz and not obj.hd_cases: # force to remove dialyzer=self.get_dlz(obj.id) if dialyzer: vals['dialyzers'].append(('create',dialyzer))