xxxx
parent
d0395e9fcf
commit
fdb60c2c95
|
@ -2,5 +2,6 @@
|
|||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="formular"/>
|
||||
<field name="description"/>
|
||||
<field name="sequence"/>
|
||||
</list>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<calendar model="clinic.schedule" start_field="time_start" end_field="time_stop">
|
||||
<calendar model="clinic.schedule" date_field="date" start_field="time_start" end_field="time_stop">
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
</calendar>
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
<item string="Copy" method="copy"/>
|
||||
<item string="Copy From" action="clinic_schedule_copy"/>
|
||||
<item string="Copy Nurses To Schedule" action="clinic_load_nurses"/>
|
||||
<item string="Copy Nurses To Cycle Item" method="copy2cycle_item"/>
|
||||
<item string="Clear List" method="clear" states="draft"/>
|
||||
</button>
|
||||
</head>
|
||||
<tabs>
|
||||
|
@ -31,7 +33,6 @@
|
|||
</tabs>
|
||||
<foot>
|
||||
<button string="Confirm" type="success" icon="ok" method="confirm" states="draft" />
|
||||
<button string="Clear List" type="danger" icon="remove" method="clear" states="draft" />
|
||||
<button string="To Draft" type="default" icon="repeat" method="to_draft" states="confirmed" />
|
||||
</foot>
|
||||
</form>
|
||||
|
|
|
@ -56,6 +56,7 @@ class CycleItem(Model):
|
|||
})
|
||||
return cd_id
|
||||
|
||||
|
||||
def create(self, vals,**kw):
|
||||
date=vals['date']
|
||||
cycle_id=vals['cycle_id']
|
||||
|
|
|
@ -11,13 +11,20 @@ class Schedule(Model):
|
|||
def _get_name(self,ids,context={}):
|
||||
res={}
|
||||
for obj in self.browse(ids):
|
||||
res[obj.id]='%s'%(obj.date)
|
||||
st="\n" # XXX
|
||||
for line in obj.lines:
|
||||
nurse=line.nurse_id
|
||||
st+='%s %s\n'%(nurse.name, nurse.level_id.name or "")
|
||||
res[obj.id]='%s'%(st)
|
||||
return res
|
||||
|
||||
def _get_item(self,ids,context={}):
|
||||
res={}
|
||||
for obj in self.browse(ids):
|
||||
item_ids=get_model("clinic.cycle.item").search([['cycle_id','=',obj.cycle_id.id],['date','=',obj.time_start[0:10]]])
|
||||
cycle_id=None
|
||||
if obj.cycle_id:
|
||||
cycle_id=obj.cycle_id.id
|
||||
item_ids=get_model("clinic.cycle.item").search([['cycle_id','=',cycle_id],['date','=',obj.time_start[0:10]]])
|
||||
item_id=None
|
||||
if item_ids:
|
||||
item_id=item_ids[0]
|
||||
|
@ -99,7 +106,14 @@ class Schedule(Model):
|
|||
'nurse_id': nurse.id,
|
||||
'level_id': nurse.level_id.id,
|
||||
}))
|
||||
print('xx')
|
||||
if not obj.cycle_item_id:
|
||||
item_id=get_model("clinic.cycle.item").create({
|
||||
'date': obj.date,
|
||||
'cycle_id': obj.cycle_id.id,
|
||||
})
|
||||
obj.write({
|
||||
'cycle_item_id': item_id,
|
||||
})
|
||||
for nurse in obj.cycle_item_id.nurses:
|
||||
nurse.delete()
|
||||
|
||||
|
|
|
@ -143,8 +143,8 @@ class ScheduleCopy(Model):
|
|||
return {
|
||||
'next': {
|
||||
'name': 'clinic_schedule',
|
||||
'mode': 'form',
|
||||
'active_id': obj.schedule_id.id,
|
||||
'mode': 'list',
|
||||
#'active_id': obj.schedule_id.id,
|
||||
},
|
||||
'flash': 'Copy successully',
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue