From f2daf4548677e3ec796d3e39f24b7c5be9e99440 Mon Sep 17 00:00:00 2001 From: SPP Date: Tue, 23 Jan 2018 15:53:32 +0700 Subject: [PATCH 1/2] sickbed menu under hdcase menu --- netforce_clinic/layouts/clinic_menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netforce_clinic/layouts/clinic_menu.xml b/netforce_clinic/layouts/clinic_menu.xml index 90d0136..761b59e 100644 --- a/netforce_clinic/layouts/clinic_menu.xml +++ b/netforce_clinic/layouts/clinic_menu.xml @@ -39,6 +39,7 @@ + @@ -53,7 +54,6 @@ - From 89d056f87f6cdfcd966e7ec10de239d3126e0046 Mon Sep 17 00:00:00 2001 From: SPP Date: Tue, 23 Jan 2018 15:54:08 +0700 Subject: [PATCH 2/2] solve permissin denied on report hdcase summary --- netforce_clinic/models/report_hd_case_summary.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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={}):