diff --git a/netforce_clinic/models/report_discontinue_patient.py b/netforce_clinic/models/report_discontinue_patient.py index 32e80be..851d02d 100644 --- a/netforce_clinic/models/report_discontinue_patient.py +++ b/netforce_clinic/models/report_discontinue_patient.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, get_active_user, set_active_user from . import utils @@ -76,6 +76,8 @@ class ReportDiscontinuePatient(Model): records=get_model('clinic.patient.move').search_browse(dom) lines=[] no=1 + user_id=get_active_user() + set_active_user(1) for record in records: if record.patient_id.branch_id.id!=branch_id: continue @@ -91,6 +93,7 @@ class ReportDiscontinuePatient(Model): 'resign_date': record.date[:10] or '', }) no+=1 + set_active_user(user_id) month_str=utils.MONTHS['th_TH'][int(month)] start=int(time_start[8:10]) stop=int(time_stop[8:10]) diff --git a/netforce_clinic/models/report_recent_patient.py b/netforce_clinic/models/report_recent_patient.py index 112074a..fbf62f9 100644 --- a/netforce_clinic/models/report_recent_patient.py +++ b/netforce_clinic/models/report_recent_patient.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, get_active_user +from netforce.access import get_active_company, get_active_user, set_active_user from . import utils @@ -75,6 +75,8 @@ class ReportRecentPatient(Model): records=get_model('clinic.patient.move').search_browse(dom) lines=[] no=1 + user_id=get_active_user() + set_active_user(1) for record in records: if record.patient_id.branch_id.id!=branch_id: continue @@ -90,6 +92,7 @@ class ReportRecentPatient(Model): 'reg_date': record.date[:10], }) no+=1 + set_active_user(user_id) month_str=utils.MONTHS['th_TH'][int(month)] start=int(time_start[8:10])