Commit 9b33c55d authored by wenjie.zheng's avatar wenjie.zheng

erp5_workflow: WorkflowTool_convertWorkflow move workflow reassignment into conversion function.

parent d2ad806f
......@@ -85,22 +85,9 @@ for workflow in selected_workflow_list:\n
\'portal_status_message=%s\' % ( context.absolute_url(),\n
url_quote(\'workflow(s) is already exist.\')))\n
\n
# conversion\n
dc_workflow_xml = workflow.showAsXML()\n
# conversion and reassignment\n
new_workflow = context.dc_workflow_asERP5Object(context, workflow, temp=0)\n
selected_workflow_id_list.append(workflow.id)\n
#assert new_workflow.showAsXML() == dc_workflow_xml\n
\n
type_workflow_dict = context.getChainsByType()\n
for ptype_id in type_workflow_dict:\n
ptype = getattr(context.getPortalObject().portal_types, ptype_id, None)\n
if ptype is not None and workflow.id in context.getChainsByType()[ptype_id]:\n
# 1. clean DC workflow assignement:\n
context.delTypeCBT(ptype.id, workflow.id)\n
# 2. assign ERP5 Workflow to portal type:\n
type_workflow_list = ptype.getTypeWorkflowList()\n
if new_workflow.getId() not in type_workflow_list:\n
ptype.addTypeWorkflowList(new_workflow.getId())\n
\n
if batch_mode:\n
return\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