diff --git a/netforce_clinic/layouts/clinic_hd_case_form.xml b/netforce_clinic/layouts/clinic_hd_case_form.xml
index bdfe437..6074ccd 100644
--- a/netforce_clinic/layouts/clinic_hd_case_form.xml
+++ b/netforce_clinic/layouts/clinic_hd_case_form.xml
@@ -36,14 +36,13 @@
-
-
+
+
-
diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py
index d289ab8..f55ad23 100644
--- a/netforce_clinic/models/hd_case.py
+++ b/netforce_clinic/models/hd_case.py
@@ -460,6 +460,9 @@ class HDCase(Model):
def cancelled(self,ids,context={}):
obj=self.browse(ids)[0]
+ obj.sickbed_id.write({
+ 'available': True,
+ })
obj.write({"state":"cancelled"})
def make_invoices(self,ids,context={}):
@@ -912,6 +915,10 @@ class HDCase(Model):
obj.write({
'state': state,
})
+ # update sickbed
+ obj.sickbed_id.write({
+ 'available': False,
+ })
return {
'next': {
@@ -967,7 +974,7 @@ class HDCase(Model):
'nurse_id': nurse_id,
})
obj.sickbed_id.write({
- 'state': 'available',
+ 'available': True,
})
set_active_user(user_id)
return {
@@ -1383,7 +1390,7 @@ class HDCase(Model):
if vals['sickbed_id']!=obj.sickbed_id.id and obj.state!='draft':
if obj.sickbed_id:
obj.sickbed_id.write({
- 'state': 'available',
+ 'available': True,
})
sb=get_model("clinic.sickbed").browse(vals['sickbed_id'])
sb.write({
@@ -1429,6 +1436,13 @@ class HDCase(Model):
data['duration']=cycle.duration
return data
+ def onchange_weight(self,context={}):
+ data=context['data']
+ wt_stop=data['wt_stop'] or 0
+ wt_start=data['wt_start'] or 0
+ data['ultrafittration']=wt_stop-wt_start
+ return data
+
def new_shop(self,ids,context={}):
return {
'next': {
diff --git a/netforce_clinic/models/hd_case_popup_discontinue.py b/netforce_clinic/models/hd_case_popup_discontinue.py
index e0e6a10..e5c901f 100644
--- a/netforce_clinic/models/hd_case_popup_discontinue.py
+++ b/netforce_clinic/models/hd_case_popup_discontinue.py
@@ -53,7 +53,9 @@ class HDCasePopupDiscontinue(Model):
'note': obj.note,
'state': 'cancelled',
})
-
+ hd_case.sickbed_id.write({
+ 'available': True,
+ })
prod_ids=[]
for line in obj.lines:
prod=line.product_id