set available sickbed

v2
watcha.h 2017-06-10 22:50:43 +07:00
parent 7474718073
commit 18e88f1ad6
1 changed files with 6 additions and 2 deletions

View File

@ -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 {