allow user to see doctor diffrent department in visit board
parent
7b01f7835d
commit
5867a9bcfb
|
@ -1,7 +1,7 @@
|
|||
<menu string="Clinic" perm="clinic">
|
||||
<item string="Dashboard" action="clinic_board"/>
|
||||
<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="Nurses" action="clinic_staff" action_options="tab_no=4"/>
|
||||
<divider/>
|
||||
|
|
|
@ -1199,12 +1199,12 @@ class HDCase(Model):
|
|||
vals=self.get_hct(vals,patient_id)
|
||||
new_id=super().create(vals,**kw)
|
||||
self.function_store([new_id])
|
||||
obj=self.browse(new_id)
|
||||
self.check_hct(obj)
|
||||
#obj=self.browse(new_id)
|
||||
#self.check_hct(obj)
|
||||
return new_id
|
||||
|
||||
def check_hct(self,obj):
|
||||
if obj.hct_include:
|
||||
if obj.hct_include and obj.state=='in_progress':
|
||||
if not obj.hct:
|
||||
raise Exception("Please define HCT")
|
||||
else:
|
||||
|
|
|
@ -4,7 +4,7 @@ from calendar import monthrange
|
|||
from datetime import datetime, timedelta
|
||||
#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
|
||||
|
||||
|
@ -73,6 +73,7 @@ class VisitBoard(Model):
|
|||
branch_id=None
|
||||
|
||||
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]])
|
||||
if sts:
|
||||
department_id=sts[0].department_id.id
|
||||
|
@ -195,8 +196,6 @@ class VisitBoard(Model):
|
|||
number='*Cancelled'
|
||||
else:
|
||||
number+='*Cancelled'
|
||||
|
||||
|
||||
line={
|
||||
'number': number,
|
||||
'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_to': utils.date2thai(date_to,format='%(d)s %(Tm)s %(By)s',lang="th_TH2"),
|
||||
}
|
||||
|
||||
set_active_user(user_id)
|
||||
return data
|
||||
|
||||
def onchange_date(self,context={}):
|
||||
|
|
Loading…
Reference in New Issue