conv_bal
watcha.h@almacom.co.th 2015-01-11 21:26:08 +07:00
parent fff0b61903
commit c5b922e7ff
3 changed files with 7 additions and 5 deletions

View File

@ -2,11 +2,12 @@
<head>
<field name="state"/>
<button string="Options" dropdown="1">
<item string="Copy" method="copy"/>
<item string="Copy By Duration" action="clinic_schedule_copy"/>
<!--<item string="Copy" method="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 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"/>
</button>
</head>

View File

@ -19,7 +19,7 @@ class Schedule(Model):
nurse=line.nurse_id
level=line.level_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
res[obj.id]='%s'%(st if count else 'No nurse')
return res

View File

@ -3,6 +3,7 @@ from netforce.model import Model, fields, get_model
FMT_DATE="%Y-%m-%d"
FMT_DATETIME="%Y-%m-%d %H:%M:%S"
DAY_TO=1
class ScheduleCopy(Model):
_name="clinic.schedule.copy"
@ -42,7 +43,7 @@ class ScheduleCopy(Model):
if schedule_id:
schedule=get_model("clinic.schedule").browse(int(schedule_id))
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
_defaults={