diff --git a/netforce_clinic/layouts/clinic_cycle_form.xml b/netforce_clinic/layouts/clinic_cycle_form.xml
index fc4271c..f5ef225 100644
--- a/netforce_clinic/layouts/clinic_cycle_form.xml
+++ b/netforce_clinic/layouts/clinic_cycle_form.xml
@@ -1,5 +1,16 @@
diff --git a/netforce_clinic/layouts/clinic_hd_case_form.xml b/netforce_clinic/layouts/clinic_hd_case_form.xml
index c67ba1c..b9ccf73 100644
--- a/netforce_clinic/layouts/clinic_hd_case_form.xml
+++ b/netforce_clinic/layouts/clinic_hd_case_form.xml
@@ -2,7 +2,8 @@
diff --git a/netforce_clinic/layouts/clinic_menu.xml b/netforce_clinic/layouts/clinic_menu.xml
index 74810d1..a7467fd 100644
--- a/netforce_clinic/layouts/clinic_menu.xml
+++ b/netforce_clinic/layouts/clinic_menu.xml
@@ -16,6 +16,7 @@
+
-
@@ -24,11 +25,11 @@
+
+
-
-
-
diff --git a/netforce_clinic/models/cycle.py b/netforce_clinic/models/cycle.py
index 68d1c4b..30cf40d 100644
--- a/netforce_clinic/models/cycle.py
+++ b/netforce_clinic/models/cycle.py
@@ -9,14 +9,18 @@ class Cycle(Model):
"name": fields.Char("Name",required=True,search=True),
'duration': fields.Integer("Duration (hrs)"),
'sequence': fields.Integer("Sequence"),
- 'comapany_id': fields.Many2One("company", "Company"),
+ 'company_id': fields.Many2One("company", "Company"),
+ 'hd_cases': fields.One2Many("clinic.hd.case","cycle_id", "HD Cases"),
+ 'visits': fields.One2Many("clinic.visit","cycle_id", "Visits"),
+ 'var_k': fields.Float("K"),
+ 'var_x': fields.Float("X"),
}
_defaults={
'duration': 1,
'sequence': 1,
- 'comapany_id': lambda *a: get_active_company(),
+ 'company_id': lambda *a: get_active_company(),
}
diff --git a/netforce_clinic/models/department.py b/netforce_clinic/models/department.py
index 874816c..54475f8 100644
--- a/netforce_clinic/models/department.py
+++ b/netforce_clinic/models/department.py
@@ -1,9 +1,9 @@
from netforce.model import Model, fields
+from netforce.access import get_active_company
class Department(Model):
_name="clinic.department"
_string="Department"
- #_name_field="name"
_fields={
"name": fields.Char("Name",required=True,search=True),
@@ -11,4 +11,8 @@ class Department(Model):
"parent_id": fields.Many2One("clinic.department", "Parent"),
}
+ _defaults={
+ 'company_id': lambda *a: get_active_company(),
+ }
+
Department.register()
diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py
index 118bf86..859394f 100644
--- a/netforce_clinic/models/hd_case.py
+++ b/netforce_clinic/models/hd_case.py
@@ -551,11 +551,12 @@ class HDCase(Model):
payment.delete()
for pm_line in obj.payment_lines:
pm_line.delete()
-
+ state=context.get("state","in_progress") #force state
obj.write({
- 'state': 'in_progress',
+ 'state': state,
'fee_paid': False,
})
+
return {
'next': {
'name': 'clinic_hd_case',
@@ -656,5 +657,10 @@ class HDCase(Model):
},
'flash': 'Create new dialyzer successfully',
}
+
+ def to_draft(self,ids,context={}):
+ obj=self.browse(ids)[0]
+ context['state']='draft'
+ obj.undo(context=context)
HDCase.register()