diff --git a/netforce_clinic/layouts/clinic_hd_case_form.xml b/netforce_clinic/layouts/clinic_hd_case_form.xml
index 6074ccd..a351915 100644
--- a/netforce_clinic/layouts/clinic_hd_case_form.xml
+++ b/netforce_clinic/layouts/clinic_hd_case_form.xml
@@ -7,6 +7,7 @@
diff --git a/netforce_clinic/layouts/clinic_staff_rotate_list.xml b/netforce_clinic/layouts/clinic_staff_rotate_list.xml
index da8dfdb..ee8c061 100644
--- a/netforce_clinic/layouts/clinic_staff_rotate_list.xml
+++ b/netforce_clinic/layouts/clinic_staff_rotate_list.xml
@@ -1,4 +1,8 @@
+
+
+
+
diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py
index e5508b9..b5709d2 100644
--- a/netforce_clinic/models/hd_case.py
+++ b/netforce_clinic/models/hd_case.py
@@ -1487,5 +1487,25 @@ class HDCase(Model):
'name': 'clinic_popup_shop',
}
}
+
+ def drop_dlz(self,ids,context={}):
+ obj=self.browse(ids)[0]
+ for dline in obj.dialyzers:
+ use_time=dline.use_time or 0
+ dlz=dline.dialyzer_id
+ if dlz.state=='drop':
+ raise Exception("%s is drop!"%dlz.number)
+ dlz.write({
+ 'use_time': use_time,
+ })
+ dlz.drop(context=context)
+ return {
+ 'next': {
+ 'name': 'clinic_hd_case',
+ 'mode': 'form',
+ 'active_id': obj.id,
+ },
+ 'flash': '%s is droped'%dlz.number,
+ }
HDCase.register()
diff --git a/netforce_clinic/models/setting.py b/netforce_clinic/models/setting.py
index 6f4756b..faa7e26 100644
--- a/netforce_clinic/models/setting.py
+++ b/netforce_clinic/models/setting.py
@@ -150,6 +150,13 @@ class ClinicSetting(Model):
print("Only admin!!")
return
+ for rt in get_model("clinic.staff.rotation").search_browse([]):
+ rt.write({
+ 'note': ' ',
+ })
+ print("Done!")
+ return
+
files=['Patients_Data_LS1.csv','Patients_Data_LS2.csv','Patients_Data_LS3.csv']
self.update_patient_file(files)
print("Done!")
diff --git a/netforce_clinic/models/staff.py b/netforce_clinic/models/staff.py
index a6badbf..49b118e 100644
--- a/netforce_clinic/models/staff.py
+++ b/netforce_clinic/models/staff.py
@@ -38,7 +38,7 @@ class Staff(Model):
ot_per_cycle=0
level_id=None
categ_id=None
- for rotate in obj.rotations:
+ for rotate in sorted(obj.rotations,key=lambda x: x.hire_date or ""):
if rotate.state=='approved':
level_id=rotate.level_id.id
wage=rotate.wage
diff --git a/netforce_clinic/models/staff_rotation.py b/netforce_clinic/models/staff_rotation.py
index beb6e16..7546bc5 100644
--- a/netforce_clinic/models/staff_rotation.py
+++ b/netforce_clinic/models/staff_rotation.py
@@ -24,7 +24,7 @@ class StaffRotation(Model):
"level_id": fields.Many2One("clinic.staff.level","Level", search=True),
"hire_date": fields.Date("Date", search=True),
"resign_date": fields.Date("Resign Date", search=True),
- "wage": fields.Float("Wage"),
+ "wage": fields.Float("Salary"),
"max_cycle": fields.Integer("Max Cycle"),
"ot_per_cycle": fields.Float("OT/Cycle"),
"note": fields.Text("Note"),
@@ -51,6 +51,8 @@ class StaffRotation(Model):
def approve(self,ids,context={}):
for obj in self.browse(ids):
+ if obj.state=='approved':
+ continue
obj.write({
'state': 'approved',
})