Commit 1e4af19c authored by wenjie.zheng's avatar wenjie.zheng Committed by Sebastien Robin

erp5_workflow: rename chain_by_type repair script; add a type check in convertion workflow.

parent d5ebc15e
......@@ -89,14 +89,14 @@ for dc_wf in selected_wf_list:\n
\n
type_workflow_dict = context.getChainsByType()\n
for ptype_id in type_workflow_dict:\n
ptype = getattr(context.getPortalObject().portal_types, ptype_id)\n
# 1. clean DC workflow assignement:\n
context.delTypeCBT(ptype.id, dc_wf.id)\n
\n
# 2. assign ERP5 Workflow to portal type:\n
type_workflow_list = ptype.getTypeWorkflowList()\n
if workflow.getId() not in type_workflow_list:\n
ptype.addTypeWorkflowList(workflow.getId())\n
ptype = getattr(context.getPortalObject().portal_types, ptype_id, None)\n
if ptype is not None:\n
# 1. clean DC workflow assignement:\n
context.delTypeCBT(ptype.id, dc_wf.id)\n
# 2. assign ERP5 Workflow to portal type:\n
type_workflow_list = ptype.getTypeWorkflowList()\n
if workflow.getId() not in type_workflow_list:\n
ptype.addTypeWorkflowList(workflow.getId())\n
\n
return RESPONSE.redirect("%s/view?portal_status_message=Workflow+%s+converted"\n
%(context.absolute_url(), \',+\'.join(selected_wf_id_list)))\n
......
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