From 7cb1e14c0911aa32a1f574946e069a6ebf9163d4 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Tue, 17 Mar 2015 11:01:06 +0700 Subject: [PATCH] select company --- netforce_clinic/models/select_company.py | 23 ++++++------- netforce_clinic/todo.txt | 41 +++--------------------- 2 files changed, 17 insertions(+), 47 deletions(-) diff --git a/netforce_clinic/models/select_company.py b/netforce_clinic/models/select_company.py index 145c601..ad6dad7 100644 --- a/netforce_clinic/models/select_company.py +++ b/netforce_clinic/models/select_company.py @@ -141,8 +141,6 @@ class SelectCompany(Model): def select(self,ids,context={}): user_id=get_active_user() - if user_id==1: - return user=get_model('base.user').browse(user_id) obj=self.browse(ids)[0] department_name='' @@ -185,6 +183,10 @@ class SelectCompany(Model): branch_id=None user=get_model("base.user").browse(user_id) dpt=user.department_id + res={ + 'department_id': None, + 'branch_id': None, + } if not dpt: dpts=user.department_profile_id.departments if dpts: @@ -192,14 +194,13 @@ class SelectCompany(Model): 'department_ids': [dpt.id for dpt in dpts], 'branch_id': dpts[0].branch_id.id, #XXX } - return res - else: - return {} - department_id=dpt.id - branch_id=dpt.branch_id.id - return { - 'department_id': department_id, - 'branch_id': branch_id, - } + else: + department_id=dpt.id + branch_id=dpt.branch_id.id + res={ + 'department_id': department_id, + 'branch_id': branch_id, + } + return res SelectCompany.register() diff --git a/netforce_clinic/todo.txt b/netforce_clinic/todo.txt index 9ecb380..93e68d0 100644 --- a/netforce_clinic/todo.txt +++ b/netforce_clinic/todo.txt @@ -1,37 +1,6 @@ -- permission - - sickbed -> can not see sickbed because mix patient - - fixme: - - see deparment from sickbed => hd_case => and update department of patient (manymany) - - hd case => can not click next page - -report cycle item : - - sunanna can not see - -report: - - reciept: - - remove border line - -- merge doctor: ** - - ทวีชัย -- merge patient - - สมเศียร - -- ***Sequence Number: - - Invoice - - LS, LK - - Extract number (Invoice) * - - wrong GI number -- *** update patient for K. Ekk - -after training -- prevent douplicate - - visit - patient_id,date,cycle_id +- report + - walkin +- receipt +- merge data - patient - -name - - staff - -name - -- prevent to gen walk in -> ok -- report P. Moo -> ok - - receipt no + - doctor