fix permission

report_acc_hdcase_summary
watcha.h 2016-12-01 01:52:00 +07:00
parent 17d342155a
commit 67f5bfa29d
2 changed files with 10 additions and 4 deletions

View File

@ -103,7 +103,9 @@ class ReportMedicalDetail(Model):
shop_dom.append(['shop_id.branch_id','=',branch_id])
if department_id:
dom.append(['hd_case_id.department_id','=',department_id])
dom.append(['hd_case_id.patient_id.department_id','=',department_id])
shop_dom.append(['shop_id.department_id','=',department_id])
shop_dom.append(['shop_id.patient_id.department_id','=',department_id])
st=get_model("clinic.setting").browse(1)
ct_ids=[]
for categ in st.product_categ_view:
@ -122,6 +124,7 @@ class ReportMedicalDetail(Model):
dom.append(["hd_case_id.state","not in",["waiting_payment","paid"]])
lines=[]
total_qty=0
print('DOM ', dom)
for line in get_model('clinic.hd.case.line').search_browse(dom):
hdcase=line.hd_case_id
patient=hdcase.patient_id

View File

@ -87,6 +87,7 @@ class ReportMedicalSummary(Model):
['date','>=',time_start],
['date','<=',time_stop],
['department_id','=',department_id],
['patient_id.department_id','=',department_id],
['branch_id','=',branch_id],
]
dom.append(['type','=','stock'])
@ -122,6 +123,7 @@ class ReportMedicalSummary(Model):
dom.append(['branch_id','=',branch_id])
if department_id:
dom.append(['department_id','=',department_id])
dom.append(['patient_id.department_id','=',department_id])
if report_type=='completed':
dom.append(["state","in",["waiting_payment","paid"]])
else:
@ -136,10 +138,11 @@ class ReportMedicalSummary(Model):
continue
if categ and categ.id not in list(categ_ids):
continue
if themself_id and patient_type_id!=themself_id and line.reimbursable=='no':
products[prod_code][themself_id]['qty']+=line.qty
else:
products[prod_code][patient_type_id]['qty']+=line.qty
#This will be combine to cash payment. To know CHECK WITH P Moo
#if themself_id and patient_type_id!=themself_id and line.reimbursable=='no':
#products[prod_code][themself_id]['qty']+=line.qty
#else:
products[prod_code][patient_type_id]['qty']+=line.qty
# add qty from rd shop
for shop in get_model("clinic.shop").search_browse(shop_dom):