diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index 332c0a1..835c39f 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -906,7 +906,10 @@ class HDCase(Model): context['date']=obj.date number=self._get_number(context=context) vals['number']=number - + if obj.sickbed_id: + obj.sickbed_id.write({ + 'available': False, + }) # update start time st=get_model("clinic.setting").browse(1) if st.real_time: @@ -916,6 +919,7 @@ class HDCase(Model): vals['time_stop']='%s %s'%(date,timenow) obj.write(vals) + def discontinue(self,ids,context={}): obj=self.browse(ids)[0] # TODO pop to note @@ -1115,7 +1119,7 @@ class HDCase(Model): # update sickbed if obj.sickbed_id: obj.sickbed_id.write({ - 'available': False, + 'available': True, }) obj.recompute_labor_cost() return {