xxxx
parent
dc8282afde
commit
1830090e04
|
@ -2,9 +2,8 @@
|
|||
<head>
|
||||
<field name="state"/>
|
||||
<button string="Options" dropdown="1">
|
||||
<!--<item string="Load Nurses" method="load_nurse_from_schedule" states='draft'/>-->
|
||||
<item string="Copy Nurses" method="cycle_item_copy" states='draft'/>
|
||||
<item string="Recheck HD Case" method="update_hdcase" states="draft" confirm="Are you sure?"/>
|
||||
<!--<item string="Recheck HD Case" method="update_hdcase" states="draft" confirm="Are you sure?"/>-->
|
||||
<item string="View Schedule" method="view_schedule"/>
|
||||
<item string="To Draft" method="to_draft" states="validated" />
|
||||
</button>
|
||||
|
@ -23,7 +22,6 @@
|
|||
<field name="nurse_id" domain='[["type","=","nurse"]]' onchange="onchange_nurse"/>
|
||||
<field name="level_id"/>
|
||||
<field name="categ_id"/>
|
||||
<!--<field name="state"/>-->
|
||||
</list>
|
||||
</field>
|
||||
</tab>
|
||||
|
@ -33,7 +31,6 @@
|
|||
</tab>
|
||||
</tabs>
|
||||
<related>
|
||||
<!--<field name="visits"/>-->
|
||||
<field name="hd_cases"/>
|
||||
<field name="comments"/>
|
||||
</related>
|
||||
|
|
|
@ -44,7 +44,7 @@ class Patient(Model):
|
|||
'type_id': fields.Many2One("clinic.patient.type","Type",search=True,required=True),
|
||||
"number": fields.Char("HN Number",required=True,search=True),
|
||||
"trt_no": fields.Char("TRT",search=True),
|
||||
"hn_no": fields.Char("HN",function="_get_hn_no"),
|
||||
"hn_no": fields.Char("HN",function="_get_hn_no",store=True),
|
||||
"hn": fields.Char("REF/HN",search=False),
|
||||
"name": fields.Char("Name",required=True,search=True),
|
||||
"reg_date": fields.Date("Register Date",required=False,search=True),
|
||||
|
@ -250,8 +250,11 @@ class Patient(Model):
|
|||
vals=[]
|
||||
for obj in self.browse(ids):
|
||||
name=obj.name or ''
|
||||
nick_name=obj.nick_name or ""
|
||||
if nick_name:
|
||||
name+=" (%s)"%nick_name
|
||||
if obj.hn_no:
|
||||
name+=" (HN: %s)"%obj.hn_no
|
||||
name+=" / %s"%obj.hn_no
|
||||
vals.append((obj.id,name,obj.image))
|
||||
return vals
|
||||
|
||||
|
@ -260,16 +263,13 @@ class Patient(Model):
|
|||
if domain:
|
||||
dom=[dom,domain]
|
||||
ids1=self.search(dom)
|
||||
dom=[["number","ilike","%"+name+"%"]]
|
||||
|
||||
dom=[["hn_no","ilike","%"+name+"%"]]
|
||||
if domain:
|
||||
dom=[dom,domain]
|
||||
ids2=self.search(dom)
|
||||
|
||||
ids=list(set(ids1+ids2))
|
||||
#dom=[["hn","ilike","%"+name+"%"]]
|
||||
#if domain:
|
||||
#dom=[dom,domain]
|
||||
#ids3=self.search(dom)
|
||||
#ids=list(set(ids1+ids2+ids3))
|
||||
return self.name_get(ids,context=context)
|
||||
|
||||
def simple_address(self,ids,context={}):
|
||||
|
|
|
@ -108,50 +108,9 @@ class ClinicSetting(Model):
|
|||
if user_id !=1:
|
||||
print("Only admin!!")
|
||||
return
|
||||
obj=self.browse(1)
|
||||
categs={}
|
||||
for ct in get_model("clinic.staff.categ").search_read([['type','=','nurse']],['name']):
|
||||
categs[ct['name']]=ct['id']
|
||||
|
||||
for cline in get_model("clinic.cycle.item.line").search_browse([]):
|
||||
nr=cline.nurse_id
|
||||
st=nr.state or ""
|
||||
if st=='part_time':
|
||||
st='Part Time'
|
||||
elif st=='full_time':
|
||||
st='Full Time'
|
||||
else:
|
||||
st='Others'
|
||||
ct_id=categs.get(st,None)
|
||||
cline.write({
|
||||
'categ_id': ct_id,
|
||||
})
|
||||
|
||||
for cline in get_model("clinic.labor.cost.line").search_browse([]):
|
||||
staff=cline.staff_id
|
||||
st=staff.state or ""
|
||||
if st=='part_time':
|
||||
st='Part Time'
|
||||
elif st=='full_time':
|
||||
st='Full Time'
|
||||
else:
|
||||
st='Others'
|
||||
ct_id=categs.get(st,None)
|
||||
cline.write({
|
||||
'categ_id': ct_id,
|
||||
})
|
||||
|
||||
for staff in get_model("clinic.staff").search_browse([]):
|
||||
st=staff.state
|
||||
if st=='part_time':
|
||||
st='Part Time'
|
||||
elif st=='full_time':
|
||||
st='Full Time'
|
||||
else:
|
||||
st='Others'
|
||||
ct_id=categs.get(st,None)
|
||||
staff.write({
|
||||
'categ_id': ct_id,
|
||||
for pt in get_model("clinic.patient").search_browse([]):
|
||||
pt.write({
|
||||
'hn_no': pt.number or "",
|
||||
})
|
||||
print("Done! ")
|
||||
|
||||
|
|
|
@ -197,8 +197,11 @@ class Staff(Model):
|
|||
for obj in self.browse(ids):
|
||||
level=obj.level_id
|
||||
name=obj.name or ""
|
||||
nickname=obj.nick_name or ""
|
||||
if level:
|
||||
name+=" (%s)"%(level.name or "")
|
||||
if nickname:
|
||||
name+=" (%s)"%(nickname)
|
||||
name+=" - %s"%(level.name or "")
|
||||
vals.append((obj.id,name))
|
||||
return vals
|
||||
|
||||
|
@ -216,8 +219,12 @@ class Staff(Model):
|
|||
level_id=x['level_id'][0]
|
||||
if level_id in level_ids:
|
||||
ids2.append(x['id'])
|
||||
dom=[["nick_name","ilike","%"+name+"%"]]
|
||||
if domain:
|
||||
dom=[dom,domain]
|
||||
ids3=self.search(dom)
|
||||
|
||||
ids=list(set(ids1+ids2))
|
||||
ids=list(set(ids1+ids2+ids3))
|
||||
return self.name_get(ids,context=context)
|
||||
|
||||
Staff.register()
|
||||
|
|
|
@ -246,6 +246,7 @@ class Visit(Model):
|
|||
# clear old nurse in cycle item
|
||||
item_id=item_ids[0]
|
||||
item=item_obj.browse(item_id)
|
||||
|
||||
#FIXME problem 1 staff can have many department
|
||||
user_id=get_active_user()
|
||||
set_active_user(1)
|
||||
|
@ -257,10 +258,11 @@ class Visit(Model):
|
|||
for line in schedule.lines:
|
||||
if line.cycle_id.id==cycle.id:
|
||||
nurse=line.nurse_id
|
||||
dpt=line.department_id
|
||||
item_vals['lines'].append(('create',{
|
||||
'nurse_id': nurse.id,
|
||||
'level_id': nurse.level_id.id,
|
||||
#'state': nurse.state,
|
||||
'department_id': dpt.id,
|
||||
'categ_id': nurse.categ_id.id,
|
||||
}))
|
||||
item.write(item_vals)
|
||||
|
@ -276,9 +278,11 @@ class Visit(Model):
|
|||
lines=[]
|
||||
for line in item2.lines:
|
||||
nr=line.nurse_id
|
||||
dpt=line.department_id
|
||||
lines.append(('create', {
|
||||
'nurse_id': nr.id,
|
||||
'level_id': nr.level_id.id,
|
||||
'department_id': dpt.id,
|
||||
'categ_id': nr.categ_id.id,
|
||||
}))
|
||||
if lines:
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
todo:
|
||||
- urgent:
|
||||
- set nurse's profile -> many2many
|
||||
- change department on user profile
|
||||
|
||||
- change profile
|
||||
- Because of one user can access more than branch
|
||||
- report doctor & nurse ***
|
||||
|
|
Loading…
Reference in New Issue