Commit 0289ac66 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_project: copy more values when add task

parent b3687b8e
# Add a task in task_module.
# Add a task in task_module
context_obj = context.getObject()
task = context.task_module.newContent( portal_type = 'Task')
# Set the source_project
task.setSourceProjectValue(context_obj)
task = context.task_module.newContent(
portal_type = 'Task',
destination = context_obj.getDestination(),
start_date = context_obj.getStartDate(),
stop_date = context_obj.getStopDate(),
task_line_quantity = context_obj.getQuantity(),
task_line_quantity_unit = context_obj.getQuantityUnit(),
description = context_obj.getDescription(),
source_project_value = context_obj
)
if context_obj.getPortalType() == 'Project Line':
task.edit(
outcome_description = context_obj.getOutcomeDescription(),
task_line_requirement_list = context_obj.getRequirementList()
)
return task.Base_redirect('view', keep_items={'portal_status_message': 'Created Task.'})
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