From da2a445432acbd77287494397b84331cfe091981 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Fri, 21 Aug 2015 11:39:38 +0700 Subject: [PATCH] show product venofer in report medical summary --- netforce_clinic/models/report_medical_detail.py | 8 ++++++-- netforce_clinic/models/report_medical_summary.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/netforce_clinic/models/report_medical_detail.py b/netforce_clinic/models/report_medical_detail.py index 60cf69b..c6f280b 100644 --- a/netforce_clinic/models/report_medical_detail.py +++ b/netforce_clinic/models/report_medical_detail.py @@ -101,8 +101,12 @@ class ReportMedicalDetail(Model): dom.append(['hd_case_id.branch_id','=',branch_id]) if department_id: dom.append(['hd_case_id.department_id','=',department_id]) - if prod_categ_id: - dom.append(['product_categ_id.id','child_of',prod_categ_id]) + st=get_model("clinic.setting").browse(1) + ct_ids=[] + for categ in st.product_categ_view: + ct_ids.append(categ.id) + if ct_ids: + dom.append(['product_categ_id.id','in',ct_ids]) if product_id: dom.append(['product_id','=',product_id]) if types and ids: diff --git a/netforce_clinic/models/report_medical_summary.py b/netforce_clinic/models/report_medical_summary.py index a83c6e1..a11bd63 100644 --- a/netforce_clinic/models/report_medical_summary.py +++ b/netforce_clinic/models/report_medical_summary.py @@ -96,7 +96,7 @@ class ReportMedicalSummary(Model): for prod in get_model("product").search_browse(dom): prod_code=prod.code or "" categ=prod.categ_id - if categ and categ.parent_id: + if categ: categ_ids.update({categ.id}) products[prod_code]={} for patient_type_id,type_name in patient_types.items():