From 5383a3cc6a3253b9f43699d2316a1776bfde2225 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Fri, 21 Aug 2015 11:22:53 +0700 Subject: [PATCH] show product by categ in clinic setting --- netforce_clinic/layouts/clinic_setting.xml | 7 ++----- .../models/report_medical_summary.py | 12 ++++++------ netforce_clinic/models/setting.py | 3 +-- .../reports/report_cycle_item.xlsx | Bin 5777 -> 5852 bytes .../templates/report_cycle_item.hbs | 2 +- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/netforce_clinic/layouts/clinic_setting.xml b/netforce_clinic/layouts/clinic_setting.xml index b33ff9e..75a0875 100644 --- a/netforce_clinic/layouts/clinic_setting.xml +++ b/netforce_clinic/layouts/clinic_setting.xml @@ -10,11 +10,6 @@ - @@ -38,4 +33,6 @@ + + diff --git a/netforce_clinic/models/report_medical_summary.py b/netforce_clinic/models/report_medical_summary.py index 9110b4b..a83c6e1 100644 --- a/netforce_clinic/models/report_medical_summary.py +++ b/netforce_clinic/models/report_medical_summary.py @@ -86,8 +86,12 @@ class ReportMedicalSummary(Model): dom=[] dom.append(['type','=','stock']) dom.append(['report_visible','=',True]) - if prod_categ_id: - dom.append(['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(['categ_id.id','in',ct_ids]) categ_ids=set() for prod in get_model("product").search_browse(dom): prod_code=prod.code or "" @@ -124,10 +128,6 @@ class ReportMedicalSummary(Model): continue if categ and categ.id not in list(categ_ids): continue - #if line.type=='fee' or prod.type=='service': - #continue - #if prod_categ_id and prod_categ_id != prod.categ_id.id: - #continue products[prod_code][patient_type_id]['qty']+=line.qty lines=[] diff --git a/netforce_clinic/models/setting.py b/netforce_clinic/models/setting.py index 10ee472..907a73f 100644 --- a/netforce_clinic/models/setting.py +++ b/netforce_clinic/models/setting.py @@ -1,4 +1,3 @@ -import time from datetime import datetime, timedelta from calendar import monthrange @@ -54,7 +53,6 @@ class ClinicSetting(Model): 'schd_to': fields.Date("To"), 'department_id': fields.Many2One("clinic.department","Department"), 'branch_id': fields.Many2One("clinic.branch","Branch"), - 'shop_categs': fields.Many2Many("product.categ","Categs"), 'shop_type_id': fields.Many2One("clinic.patient.type","Patient Type"), 'skip_type_id': fields.Many2One("clinic.patient.type","Skip Type"), # Matching HD Case "cash_account_id": fields.Many2One("account.account","Cash Account",multi_company=True), @@ -65,6 +63,7 @@ class ClinicSetting(Model): 'next_date': fields.DateTime("Next Gen"), 'staff_from_id': fields.Many2One("clinic.staff","Staff From"), 'staff_to_id': fields.Many2One("clinic.staff","Staff To"), + 'product_categ_view': fields.Many2Many("product.categ","Product Category View"), } _defaults={ diff --git a/netforce_clinic/reports/report_cycle_item.xlsx b/netforce_clinic/reports/report_cycle_item.xlsx index d867e670a277223a2813cc46222fa7992d1fc979..fc1e5b1291c1caea404f26a440b1f93becfef71f 100644 GIT binary patch delta 3340 zcmZ8kc{CK<8#YLj-B>3g*=8&yW0y6Cv1N&@*~yxnu?-rUEDeoq?4M<1DH)7p8;0y5 zQg$l)(ibXwzv?^Zx7~Bkd7k$@?>+baao_X2PrB5s6qAVo4J`*15D27FvEZm<;sVh8 z!g^7_rGE&V+VUS#M8o}u;F@VgQJKSj6Vj}`Uv4D0y?GYKpk*Rb$@&76O`?uiA_lTo zcth*VXRJebx8uyAA2AS)+mA}=9|8jI*LhF5sgJyv+te$98U4@5XCwAUK=6j z01-+IPN?Sd0H^D>ATt-1CLeUZ4FQ&QNp^xggwgC*mTZEdX=Z@U0au_dN}sbD*dMMP zD4C7a%n^ZdD_MSrgr-T-c0S@`E7@gywjc4{A zGSlLcswCuHM|rSJK5kuBL!3U%g-PM)*_cC$n%vQ&G4+X7oc^cOY6ykdvryya-gof!O#3Ilm=^{0PIkmD1Fp6 zhE16y5l|pyhYfs!SV*$*@YcGsSj}SwV* zuj!Q_T~0Jz5TPw7t0mNeFFAvLJ;c=hDiRb{gRLrwuQ$$dJ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