xxx
parent
7eda2f6369
commit
8abebc21b9
|
@ -55,9 +55,18 @@ class Staff(Model):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _get_hdcase(self,ids,context={}):
|
def _get_hdcase(self,ids,context={}):
|
||||||
|
# problem slow to load
|
||||||
res={}
|
res={}
|
||||||
for obj in self.browse(ids):
|
for obj in self.browse(ids):
|
||||||
res[obj.id]=[1]
|
hids=[]
|
||||||
|
if obj.type=='doctor':
|
||||||
|
hids=get_model("clinic.hd.case.staff").search([['staff_id','=',obj.id]])
|
||||||
|
elif obj.type=='nurse':
|
||||||
|
item_ids=[item['cycle_item_id'][0] for item in get_model("clinic.cycle.item.nurse").search_read([['nurse_id','=',obj.id]],['cycle_item_id'])]
|
||||||
|
for item in get_model("clinic.cycle.item").browse(item_ids):
|
||||||
|
for hdcase in item.hd_cases:
|
||||||
|
hids.append(hdcase.id)
|
||||||
|
res[obj.id]=hids
|
||||||
return res
|
return res
|
||||||
|
|
||||||
_fields={
|
_fields={
|
||||||
|
|
Loading…
Reference in New Issue