show product by categ in clinic setting

fix_acc
watcha.h 2015-08-21 11:22:53 +07:00
parent ea76cdc423
commit 5383a3cc6a
5 changed files with 10 additions and 14 deletions

View File

@ -10,11 +10,6 @@
<separator string="Visit"/> <separator string="Visit"/>
<group form_layout="stacked"> <group form_layout="stacked">
<field name="find_dlz"/> <field name="find_dlz"/>
<!--
<newline/>
<field name="auto_gen_visit" string="Next Gen"/>
<field name="next_date" span="3"/>
-->
</group> </group>
<separator string="HD Case"/> <separator string="HD Case"/>
<group form_layout="stacked"> <group form_layout="stacked">
@ -38,4 +33,6 @@
<separator string="RD Shop"/> <separator string="RD Shop"/>
<field name="shop_type_id"/> <field name="shop_type_id"/>
<field name="signature"/> <field name="signature"/>
<separator string="Reporting"/>
<field name="product_categ_view"/>
</form> </form>

View File

@ -86,8 +86,12 @@ class ReportMedicalSummary(Model):
dom=[] dom=[]
dom.append(['type','=','stock']) dom.append(['type','=','stock'])
dom.append(['report_visible','=',True]) dom.append(['report_visible','=',True])
if prod_categ_id: st=get_model("clinic.setting").browse(1)
dom.append(['categ_id.id','child_of',prod_categ_id]) 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() categ_ids=set()
for prod in get_model("product").search_browse(dom): for prod in get_model("product").search_browse(dom):
prod_code=prod.code or "" prod_code=prod.code or ""
@ -124,10 +128,6 @@ class ReportMedicalSummary(Model):
continue continue
if categ and categ.id not in list(categ_ids): if categ and categ.id not in list(categ_ids):
continue 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 products[prod_code][patient_type_id]['qty']+=line.qty
lines=[] lines=[]

View File

@ -1,4 +1,3 @@
import time
from datetime import datetime, timedelta from datetime import datetime, timedelta
from calendar import monthrange from calendar import monthrange
@ -54,7 +53,6 @@ class ClinicSetting(Model):
'schd_to': fields.Date("To"), 'schd_to': fields.Date("To"),
'department_id': fields.Many2One("clinic.department","Department"), 'department_id': fields.Many2One("clinic.department","Department"),
'branch_id': fields.Many2One("clinic.branch","Branch"), 'branch_id': fields.Many2One("clinic.branch","Branch"),
'shop_categs': fields.Many2Many("product.categ","Categs"),
'shop_type_id': fields.Many2One("clinic.patient.type","Patient Type"), 'shop_type_id': fields.Many2One("clinic.patient.type","Patient Type"),
'skip_type_id': fields.Many2One("clinic.patient.type","Skip Type"), # Matching HD Case '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), "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"), 'next_date': fields.DateTime("Next Gen"),
'staff_from_id': fields.Many2One("clinic.staff","Staff From"), 'staff_from_id': fields.Many2One("clinic.staff","Staff From"),
'staff_to_id': fields.Many2One("clinic.staff","Staff To"), 'staff_to_id': fields.Many2One("clinic.staff","Staff To"),
'product_categ_view': fields.Many2Many("product.categ","Product Category View"),
} }
_defaults={ _defaults={

View File

@ -49,7 +49,7 @@
<td>รวม</td> <td>รวม</td>
<td></td> <td></td>
<td style="text-align:center">{{no}}</td> <td style="text-align:center">{{no}}</td>
<td colspan="10" style="text-align:right"> <td colspan="10">
{{#each epo_items}} {{#each epo_items}}
{{name}} = {{qty}} &nbsp;&nbsp;&nbsp; {{name}} = {{qty}} &nbsp;&nbsp;&nbsp;
{{/each}} {{/each}}