fix access

conv_bal
watcha.h 2015-03-15 12:36:17 +07:00
parent a8826b9b8e
commit 2b1b63a2fc
3 changed files with 24 additions and 6 deletions

View File

@ -205,6 +205,12 @@ class Patient(Model):
if res: if res:
return res['branch_id'] 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={ _defaults={
#"number": _get_number, #"number": _get_number,
"number": "", "number": "",
@ -218,6 +224,7 @@ class Patient(Model):
'state': 'admit', 'state': 'admit',
'walkin': 'no', 'walkin': 'no',
'departments': _get_departments, 'departments': _get_departments,
'location': _get_default_location,
} }
_sql_constraints=("clinic_patient_key_uniq","unique(name_check,branch_id)","name should be unique"), _sql_constraints=("clinic_patient_key_uniq","unique(name_check,branch_id)","name should be unique"),

View File

@ -192,6 +192,12 @@ class Staff(Model):
return [res['department_id']] return [res['department_id']]
return get_model("clinic.department").search([]) 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={ _defaults={
'active': True, 'active': True,
"state": "part_time", "state": "part_time",
@ -201,6 +207,7 @@ class Staff(Model):
"company_id": lambda *a: get_active_company(), "company_id": lambda *a: get_active_company(),
'branch_id': _get_branch, 'branch_id': _get_branch,
'departments': _get_departments, 'departments': _get_departments,
'location': _get_default_location,
} }
#_key=["name_check","branch_id"] #not working #_key=["name_check","branch_id"] #not working

View File

@ -16,12 +16,14 @@ report:
- merge patient - merge patient
- สมเศียร - สมเศียร
- ** sequence invoice - ***Sequence Number:
- LS, LK - Invoice
- Extract number (Invoice) * - LS, LK
- Extract number (Invoice) *
- wrong GI number
- *** update patient for K. Ekk
- prevent to gen walk in -> ok after training
- update patient for K. Ekk
- prevent douplicate - prevent douplicate
- visit - visit
patient_id,date,cycle_id patient_id,date,cycle_id
@ -29,5 +31,7 @@ report:
-name -name
- staff - staff
-name -name
- prevent to gen walk in -> ok
- report P. Moo -> ok - report P. Moo -> ok
- wrong GI number - receipt no