conv_bal
watcha.h 2015-03-14 00:51:19 +07:00
parent 03116925db
commit ada182c083
4 changed files with 12 additions and 2 deletions

View File

@ -190,6 +190,9 @@ class Patient(Model):
return ptype_id
def _get_departments(self,context={}):
res=get_model('select.company').get_select()
if res:
return [res['department_id']]
return get_model("clinic.department").search([])
def _get_department(self,context={}):

View File

@ -70,6 +70,8 @@ class SelectCompany(Model):
branch_id=None
user=get_model("base.user").browse(user_id)
dpt=user.department_id
if not dpt:
return {}
department_id=dpt.id
branch_id=dpt.branch_id.id
return {

View File

@ -186,7 +186,10 @@ class Staff(Model):
if b_ids:
return b_ids[0]
def _get_dpts(self,context={}):
def _get_departments(self,context={}):
res=get_model('select.company').get_select()
if res:
return [res['department_id']]
return get_model("clinic.department").search([])
_defaults={
@ -197,7 +200,7 @@ class Staff(Model):
"number": _get_number,
"company_id": lambda *a: get_active_company(),
'branch_id': _get_branch,
'departments': _get_dpts,
'departments': _get_departments,
}
#_key=["name_check","branch_id"] #not working

View File

@ -0,0 +1,2 @@
- location
- staff , patient should be main