allow user to see doctor diffrent department in visit board

conv_bal
watcha.h 2015-02-16 10:55:15 +07:00
parent 7b01f7835d
commit 5867a9bcfb
3 changed files with 7 additions and 8 deletions

View File

@ -1,7 +1,7 @@
<menu string="Clinic" perm="clinic"> <menu string="Clinic" perm="clinic">
<item string="Dashboard" action="clinic_board"/> <item string="Dashboard" action="clinic_board"/>
<item string="Staffs" perm="clinic_staff"> <item string="Staffs" perm="clinic_staff">
<item string="Staffs" action="clinic_staff" action_options="tab_no=0"/> <item string="Staffs" action="clinic_staff" action_options="tab_no=1"/>
<item string="Doctors" action="clinic_staff" action_options="tab_no=3"/> <item string="Doctors" action="clinic_staff" action_options="tab_no=3"/>
<item string="Nurses" action="clinic_staff" action_options="tab_no=4"/> <item string="Nurses" action="clinic_staff" action_options="tab_no=4"/>
<divider/> <divider/>

View File

@ -1199,12 +1199,12 @@ class HDCase(Model):
vals=self.get_hct(vals,patient_id) vals=self.get_hct(vals,patient_id)
new_id=super().create(vals,**kw) new_id=super().create(vals,**kw)
self.function_store([new_id]) self.function_store([new_id])
obj=self.browse(new_id) #obj=self.browse(new_id)
self.check_hct(obj) #self.check_hct(obj)
return new_id return new_id
def check_hct(self,obj): def check_hct(self,obj):
if obj.hct_include: if obj.hct_include and obj.state=='in_progress':
if not obj.hct: if not obj.hct:
raise Exception("Please define HCT") raise Exception("Please define HCT")
else: else:

View File

@ -4,7 +4,7 @@ from calendar import monthrange
from datetime import datetime, timedelta from datetime import datetime, timedelta
#from calendar import monthrange #from calendar import monthrange
from netforce.model import Model, fields, get_model 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 from . import utils
@ -73,6 +73,7 @@ class VisitBoard(Model):
branch_id=None branch_id=None
user_id=get_active_user() user_id=get_active_user()
set_active_user(1) #FIXME to allow user to see doctor different department
sts=get_model("clinic.staff").search_browse([['user_id','=',user_id]]) sts=get_model("clinic.staff").search_browse([['user_id','=',user_id]])
if sts: if sts:
department_id=sts[0].department_id.id department_id=sts[0].department_id.id
@ -195,8 +196,6 @@ class VisitBoard(Model):
number='*Cancelled' number='*Cancelled'
else: else:
number+='*Cancelled' number+='*Cancelled'
line={ line={
'number': number, 'number': number,
'hn_name': hn_name, 'hn_name': hn_name,
@ -307,7 +306,7 @@ class VisitBoard(Model):
'date_from': utils.date2thai(date_from,format='%(d)s %(Tm)s %(By)s',lang="th_TH2"), 'date_from': utils.date2thai(date_from,format='%(d)s %(Tm)s %(By)s',lang="th_TH2"),
'date_to': utils.date2thai(date_to,format='%(d)s %(Tm)s %(By)s',lang="th_TH2"), 'date_to': utils.date2thai(date_to,format='%(d)s %(Tm)s %(By)s',lang="th_TH2"),
} }
set_active_user(user_id)
return data return data
def onchange_date(self,context={}): def onchange_date(self,context={}):