From afca84692bb1e4d4308be123b11b6fdf613bcca9 Mon Sep 17 00:00:00 2001 From: "watcha.h@almacom.co.th" Date: Mon, 11 May 2015 12:23:42 +0700 Subject: [PATCH] [hd_case] get doctor name --- netforce_clinic/models/hd_case.py | 4 ++++ netforce_clinic/models/report_labor_cost_staff.py | 1 + 2 files changed, 5 insertions(+) diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index ac0dbc6..4205754 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -1324,6 +1324,10 @@ class HDCase(Model): doctor+= 1 else: nurse+=1 + if not doctor_id: + for ps in obj.staffs: + if ps.type=="doctor": + doctor_id=ps.staff_id.id res[obj.id]={ 'total_doctor': doctor, 'total_nurse': nurse, diff --git a/netforce_clinic/models/report_labor_cost_staff.py b/netforce_clinic/models/report_labor_cost_staff.py index a764077..dca1bde 100644 --- a/netforce_clinic/models/report_labor_cost_staff.py +++ b/netforce_clinic/models/report_labor_cost_staff.py @@ -83,6 +83,7 @@ class ReportLaborCostStaff(Model): if cycle_id: dom.append(['hd_case_id.cycle_id','=',cycle_id]) lines=[] + print('dom ', dom) for sline in get_model("clinic.hd.case.staff").search_browse(dom): hdcase=sline.hd_case_id staff=sline.staff_id