diff --git a/netforce_clinic/layouts/clinic_hd_case_staff_form.xml b/netforce_clinic/layouts/clinic_hd_case_staff_form.xml index af9d6b6..07cd0b4 100644 --- a/netforce_clinic/layouts/clinic_hd_case_staff_form.xml +++ b/netforce_clinic/layouts/clinic_hd_case_staff_form.xml @@ -1,4 +1,9 @@
+ + + diff --git a/netforce_clinic/models/hd_case_staff.py b/netforce_clinic/models/hd_case_staff.py index 93f5d3b..f581286 100644 --- a/netforce_clinic/models/hd_case_staff.py +++ b/netforce_clinic/models/hd_case_staff.py @@ -1,6 +1,6 @@ import time -from netforce.model import Model, fields +from netforce.model import Model, fields, get_model class HDCaseStaff(Model): _name="clinic.hd.case.staff" @@ -41,6 +41,14 @@ class HDCaseStaff(Model): 'priop': 'personal', 'date': lambda *a: time.strftime("%Y-%m-%d"), } + + def recompute_cost(self,ids,context={}): + obj=self.browse(ids)[0] + hdcase=obj.hd_case_id + citem=hdcase.cycle_item_id + for lc in get_model('clinic.labor.cost').search_browse([['cycle_item_id','=',citem.id]]): + lc.compute() + print("Done!") HDCaseStaff.register()