SPP 2018-01-24 12:08:19 +07:00
commit 8f1edd7e5a
2 changed files with 5 additions and 3 deletions

View File

@ -39,6 +39,7 @@
<item string="HD Cases" perm="clinic_hdcase">
<item string="HD Cases" action="clinic_hd_case"/>
<item string="RD Shop" action="clinic_shop" perm="clinic_shop"/>
<item string="Sickbed" action="clinic_sickbed"/>
</item>
<item string="Reports" perm="clinic_report">
<item string="HD Case Summary (Revise)" action="report_hdcase_summary"/>
@ -53,7 +54,6 @@
<item string="Settings" perm="clinic_settings">
<item string="Clinic Settings" action="clinic_setting"/>
<divider/>
<item string="Sickbed" action="clinic_sickbed"/>
<item string="Cycles" action="clinic_cycle"/>
<item string="Hospitals" action="clinic_hospital"/>
<item string="Nationalities" action="clinic_nation"/>

View File

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