schedule
parent
fff0b61903
commit
c5b922e7ff
|
@ -2,11 +2,12 @@
|
||||||
<head>
|
<head>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
<button string="Options" dropdown="1">
|
<button string="Options" dropdown="1">
|
||||||
<item string="Copy" method="copy"/>
|
<!--<item string="Copy" method="copy"/>-->
|
||||||
<item string="Copy By Duration" action="clinic_schedule_copy"/>
|
<!--<item string="Copy By Duration" action="clinic_schedule_copy"/>-->
|
||||||
|
<item string="Copy" action="clinic_schedule_copy"/>
|
||||||
<item string="Copy Nurses To Schedule" action="clinic_load_nurses" states="draft"/>
|
<item string="Copy Nurses To Schedule" action="clinic_load_nurses" states="draft"/>
|
||||||
<item string="Copy Nurses To Cycle Item" method="copy2cycle_item" states="draft"/>
|
<item string="Copy Nurses To Cycle Item" method="copy2cycle_item" states="draft"/>
|
||||||
<item string="Reset" method="clear" confirm="Are you sure to clear list of nurse?" states="draft"/>
|
<item string="Reset Nurse" method="clear" confirm="Are you sure to clear list of nurse?" states="draft"/>
|
||||||
<item string="To Draft" method="to_draft" states="confirmed"/>
|
<item string="To Draft" method="to_draft" states="confirmed"/>
|
||||||
</button>
|
</button>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Schedule(Model):
|
||||||
nurse=line.nurse_id
|
nurse=line.nurse_id
|
||||||
level=line.level_id
|
level=line.level_id
|
||||||
cycle=line.cycle_id
|
cycle=line.cycle_id
|
||||||
st+='C%s %s %s\n'%(cycle.sequence,nurse.name,level.name or "")
|
st+='#%s %s %s\n'%(cycle.sequence,nurse.name,level.name or "")
|
||||||
count+=1
|
count+=1
|
||||||
res[obj.id]='%s'%(st if count else 'No nurse')
|
res[obj.id]='%s'%(st if count else 'No nurse')
|
||||||
return res
|
return res
|
||||||
|
|
|
@ -3,6 +3,7 @@ from netforce.model import Model, fields, get_model
|
||||||
|
|
||||||
FMT_DATE="%Y-%m-%d"
|
FMT_DATE="%Y-%m-%d"
|
||||||
FMT_DATETIME="%Y-%m-%d %H:%M:%S"
|
FMT_DATETIME="%Y-%m-%d %H:%M:%S"
|
||||||
|
DAY_TO=1
|
||||||
|
|
||||||
class ScheduleCopy(Model):
|
class ScheduleCopy(Model):
|
||||||
_name="clinic.schedule.copy"
|
_name="clinic.schedule.copy"
|
||||||
|
@ -42,7 +43,7 @@ class ScheduleCopy(Model):
|
||||||
if schedule_id:
|
if schedule_id:
|
||||||
schedule=get_model("clinic.schedule").browse(int(schedule_id))
|
schedule=get_model("clinic.schedule").browse(int(schedule_id))
|
||||||
date_to=datetime.strptime(schedule.date,FMT_DATE)
|
date_to=datetime.strptime(schedule.date,FMT_DATE)
|
||||||
date_to=(date_to+timedelta(days=8)).strftime("%Y-%m-%d")
|
date_to=(date_to+timedelta(days=DAY_TO)).strftime("%Y-%m-%d")
|
||||||
return date_to
|
return date_to
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
|
|
Loading…
Reference in New Issue