From fc4eb27a94e098ba0a11ba2e636abc1dd1e7172d Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Thu, 13 Oct 2016 07:42:14 +0700 Subject: [PATCH] alwary share doctor for every location after created by anyone --- netforce_clinic/models/staff.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/netforce_clinic/models/staff.py b/netforce_clinic/models/staff.py index 46dbd9f..4156209 100644 --- a/netforce_clinic/models/staff.py +++ b/netforce_clinic/models/staff.py @@ -203,6 +203,13 @@ class Staff(Model): def _get_departments(self,context={}): res=get_model('select.company').get_select() + type=context.get("type") + if type=='doctor': + user_id=get_active_user() + set_active_user(1) + dpts=get_model("clinic.department").search([]) + set_active_user(user_id) + return dpts if res: if res.get("department_ids"): return res['department_ids']