From 2b1b63a2fcd064a6874e81459aa0da98173ce292 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Sun, 15 Mar 2015 12:36:17 +0700 Subject: [PATCH] fix access --- netforce_clinic/models/patient.py | 7 +++++++ netforce_clinic/models/staff.py | 7 +++++++ netforce_clinic/todo.txt | 16 ++++++++++------ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/netforce_clinic/models/patient.py b/netforce_clinic/models/patient.py index 7922c1b..2996936 100644 --- a/netforce_clinic/models/patient.py +++ b/netforce_clinic/models/patient.py @@ -205,6 +205,12 @@ class Patient(Model): if res: return res['branch_id'] + def _get_default_location(self,context={}): + res=get_model('select.company').get_select() + if res: + dpt=get_model("clinic.department").browse(res['department_id']) + return dpt.code + _defaults={ #"number": _get_number, "number": "", @@ -218,6 +224,7 @@ class Patient(Model): 'state': 'admit', 'walkin': 'no', 'departments': _get_departments, + 'location': _get_default_location, } _sql_constraints=("clinic_patient_key_uniq","unique(name_check,branch_id)","name should be unique"), diff --git a/netforce_clinic/models/staff.py b/netforce_clinic/models/staff.py index 40001d6..363ca58 100644 --- a/netforce_clinic/models/staff.py +++ b/netforce_clinic/models/staff.py @@ -192,6 +192,12 @@ class Staff(Model): return [res['department_id']] return get_model("clinic.department").search([]) + def _get_default_location(self,context={}): + res=get_model('select.company').get_select() + if res: + dpt=get_model("clinic.department").browse(res['department_id']) + return dpt.code + _defaults={ 'active': True, "state": "part_time", @@ -201,6 +207,7 @@ class Staff(Model): "company_id": lambda *a: get_active_company(), 'branch_id': _get_branch, 'departments': _get_departments, + 'location': _get_default_location, } #_key=["name_check","branch_id"] #not working diff --git a/netforce_clinic/todo.txt b/netforce_clinic/todo.txt index 1e270c1..9ecb380 100644 --- a/netforce_clinic/todo.txt +++ b/netforce_clinic/todo.txt @@ -16,12 +16,14 @@ report: - merge patient - สมเศียร -- ** sequence invoice - - LS, LK - - Extract number (Invoice) * +- ***Sequence Number: + - Invoice + - LS, LK + - Extract number (Invoice) * + - wrong GI number +- *** update patient for K. Ekk -- prevent to gen walk in -> ok -- update patient for K. Ekk +after training - prevent douplicate - visit patient_id,date,cycle_id @@ -29,5 +31,7 @@ report: -name - staff -name + +- prevent to gen walk in -> ok - report P. Moo -> ok -- wrong GI number + - receipt no