diff --git a/netforce_clinic/models/report_hd_case_summary.py b/netforce_clinic/models/report_hd_case_summary.py index 33e74a0..972e817 100644 --- a/netforce_clinic/models/report_hd_case_summary.py +++ b/netforce_clinic/models/report_hd_case_summary.py @@ -4,7 +4,7 @@ import urllib.parse as urllib from datetime import datetime from calendar import monthrange from netforce.model import Model, fields, get_model -from netforce.access import get_active_company, get_active_user +from netforce.access import get_active_company, get_active_user, set_active_user from . import utils @@ -56,6 +56,7 @@ class ReportHDCaseSummary(Model): def get_report_data(self,ids,context={}): company_id=get_active_company() company=get_model("company").browse(company_id) + user_id=get_active_user() date=datetime.now().strftime("%Y-%m-%d") year=int(date[0:4]) crr_month=int(date[5:7]) @@ -271,8 +272,8 @@ class ReportHDCaseSummary(Model): plines=medicals['plines'] prod_titles=medicals['prod_titles'] date_print=time.strftime("%m/%d/%Y %H:%M:%S") - user_id=get_active_user() user=get_model('base.user').browse(user_id) + set_active_user(1) data={ 'user_name': user.name, 'hdcase_type': hdcase_type, @@ -294,6 +295,7 @@ class ReportHDCaseSummary(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={}):