From c708149d54bc32e3184bcbffe190b7f175427d05 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Tue, 29 Nov 2016 23:29:39 +0700 Subject: [PATCH] can not access patient --- netforce_clinic/models/report_hd_case_detail.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/netforce_clinic/models/report_hd_case_detail.py b/netforce_clinic/models/report_hd_case_detail.py index 64de81c..a6ee966 100644 --- a/netforce_clinic/models/report_hd_case_detail.py +++ b/netforce_clinic/models/report_hd_case_detail.py @@ -2,7 +2,7 @@ import time from calendar import monthrange from netforce.model import Model,fields,get_model -from netforce.access import get_active_company +from netforce.access import get_active_company, set_active_user, get_active_user from . import utils @@ -78,6 +78,9 @@ class ReportHDCaseDetail(Model): return res def get_report_data(self,ids,context={}): + user_id=get_active_user() + set_active_user(1) + company_id=get_active_company() company=get_model("company").browse(company_id) defaults=self.default_get(context=context) @@ -341,6 +344,7 @@ class ReportHDCaseDetail(Model): 'company_name': '%s %s'% (company.name or "", sub_name), 'parent_company_name': company.parent_id.name or "", } + set_active_user(user_id) return data def onchange_date(self,context={}):