[IMP]:improved the date start working for phase,tasks scheduling

bzr revid: rvo@tinyerp.co.in-20100226122617-l6jvjmckgjqf3chg
This commit is contained in:
Rvo (Open ERP)
2010-02-26 17:56:17 +05:30
parent 106d56a63f
commit 1adcb50ea3
3 changed files with 17 additions and 5 deletions
+4 -1
View File
@@ -58,7 +58,10 @@ class wizard_compute_tasks(wizard.interface):
task_ids.sort()
task_obj = task_pool.browse(cr,uid,task_ids)
calendar_id = project.resource_calendar_id.id
date_start = datetime.datetime.strftime(datetime.datetime.strptime(project.date_start,"%Y-%m-%d"),"%Y-%m-%d %H:%M")
start_date = project.date_start
if not project.date_start:
start_date = datetime.datetime.now().strftime("%Y-%m-%d")
date_start = datetime.datetime.strftime(datetime.datetime.strptime(start_date,"%Y-%m-%d"),"%Y-%m-%d %H:%M")
# To create resources which are the Project Members
resource_objs = []
@@ -121,7 +121,10 @@ class wizard_compute_phases(wizard.interface):
phase_ids.sort()
phase_objs = phase_pool.browse(cr,uid,phase_ids)
for phase in phase_objs:
start_dt = datetime.datetime.strftime((datetime.datetime.strptime(phase.date_start,"%Y-%m-%d %H:%M:%S")),"%Y-%m-%d %H:%M")
start_date = phase.project_id.date_start
if not phase.project_id.date_start:
start_date = datetime.datetime.now().strftime("%Y-%m-%d")
start_dt = datetime.datetime.strftime((datetime.datetime.strptime(start_date,"%Y-%m-%d")),"%Y-%m-%d %H:%M")
calendar_id = phase.project_id.resource_calendar_id.id
phase_schedule(cr,uid,phase,start_dt,calendar_id or False)
@@ -60,12 +60,18 @@ class wizard_schedule_task(wizard.interface):
user_pool = pool.get('res.users')
phase = phase_pool.browse(cr,uid,data['id'])
task_ids = map(lambda x:x.id,(filter(lambda x:x.state in ['open','draft','pending'] ,phase.task_ids)))
task_ids.sort()
tasks = task_pool.browse(cr,uid,task_ids)
if task_ids:
task_ids.sort()
tasks = task_pool.browse(cr,uid,task_ids)
wktime_cal = []
date_start = datetime.datetime.strftime(datetime.datetime.strptime(phase.date_start,"%Y-%m-%d %H:%M:%S"),"%Y-%m-%d %H:%M")
start_date = str(phase.date_start)[:-9]
if not phase.date_start:
if not phase.project_id.date_start:
start_date = datetime.datetime.now().strftime("%Y-%m-%d")
else:
start_date = phase.project_id.date_start
date_start = datetime.datetime.strftime(datetime.datetime.strptime(start_date,"%Y-%m-%d"),"%Y-%m-%d %H:%M")
calendar_id = phase.project_id.resource_calendar_id.id
resource_objs = resource_list(cr,uid,phase)
priority_dict = {'0':1000,'1':800,'2':500,'3':300,'4':100}