xxx
parent
03116925db
commit
ada182c083
|
@ -190,6 +190,9 @@ class Patient(Model):
|
||||||
return ptype_id
|
return ptype_id
|
||||||
|
|
||||||
def _get_departments(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([])
|
return get_model("clinic.department").search([])
|
||||||
|
|
||||||
def _get_department(self,context={}):
|
def _get_department(self,context={}):
|
||||||
|
|
|
@ -70,6 +70,8 @@ class SelectCompany(Model):
|
||||||
branch_id=None
|
branch_id=None
|
||||||
user=get_model("base.user").browse(user_id)
|
user=get_model("base.user").browse(user_id)
|
||||||
dpt=user.department_id
|
dpt=user.department_id
|
||||||
|
if not dpt:
|
||||||
|
return {}
|
||||||
department_id=dpt.id
|
department_id=dpt.id
|
||||||
branch_id=dpt.branch_id.id
|
branch_id=dpt.branch_id.id
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -186,7 +186,10 @@ class Staff(Model):
|
||||||
if b_ids:
|
if b_ids:
|
||||||
return b_ids[0]
|
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([])
|
return get_model("clinic.department").search([])
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
|
@ -197,7 +200,7 @@ class Staff(Model):
|
||||||
"number": _get_number,
|
"number": _get_number,
|
||||||
"company_id": lambda *a: get_active_company(),
|
"company_id": lambda *a: get_active_company(),
|
||||||
'branch_id': _get_branch,
|
'branch_id': _get_branch,
|
||||||
'departments': _get_dpts,
|
'departments': _get_departments,
|
||||||
}
|
}
|
||||||
|
|
||||||
#_key=["name_check","branch_id"] #not working
|
#_key=["name_check","branch_id"] #not working
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
- location
|
||||||
|
- staff , patient should be main
|
Loading…
Reference in New Issue