Commit 546b7bcc authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_forge: possible to create new task if previous one is finished

parent 11e7bbfe
task = context.getFollowUpRelatedValue(portal_type='Task')
if not task:
task = context.task_module.newContent(
if task:
task_report = task.getCausalityRelatedValue(portal_type='Task Report')
if task_report is None or task_report.getSimulationState() not in ('delivered'):
message = context.Base_translateString("A task is already created for this bug")
return task.Base_redirect('view', keep_items={'portal_status_message': message})
task = context.task_module.newContent(
portal_type='Task',
start_date=start_date,
stop_date=stop_date,
......@@ -12,8 +18,5 @@ if not task:
source_project = context.getSourceProject(), #project
follow_up_value = context
)
message = context.Base_translateString("A new task is created for this bug")
return task.Base_redirect('view', keep_items={'portal_status_message': message})
else:
message = context.Base_translateString("A task is already created for this bug")
return task.Base_redirect('view', keep_items={'portal_status_message': message})
message = context.Base_translateString("A new task is created for this bug")
return task.Base_redirect('view', keep_items={'portal_status_message': message})
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment