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={}):