xxx
parent
03116925db
commit
ada182c083
|
@ -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={}):
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
- location
|
||||
- staff , patient should be main
|
Loading…
Reference in New Issue