Commit 33be50d6 authored by wenjie.zheng's avatar wenjie.zheng

WorkflowTool.py: put reassignment workflow inside conversion function.

parent a5a6e859
......@@ -562,6 +562,18 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
self._finalizeWorkflowConversion(dc_workflow)
# override temporary id:
workflow.setId(workflow.default_reference)
workflow_id = workflow.getId()
# type-workflow reassignment
type_workflow_dict = self.getChainsByType()
type_tool = self.getPortalObject().portal_types
for ptype_id in type_workflow_dict:
ptype = type_tool._getOb(ptype_id, None)
if ptype is not None and workflow_id in type_workflow_dict[ptype_id]:
# 1. clean DC workflow assignement:
self.delTypeCBT(ptype_id, workflow_id)
# 2. assign ERP5 Workflow to portal type:
if workflow_id not in ptype.getTypeWorkflowList():
ptype.addTypeWorkflowList(workflow_id)
return workflow
def getChainDict(self):
......
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