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

WorkflowTool.py: Enhance doActionFor compatibility at the case which both...

WorkflowTool.py: Enhance doActionFor compatibility at the case which both workflow are assigned to the same object type AND workflow has a prior initial letter to DC workflow.
parent 18c5463d
......@@ -161,6 +161,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
def doActionFor(self, ob, action, wf_id=None, *args, **kw):
workflow_list = self.getWorkflowValueListFor(ob.getPortalType())
action_ref = action
if wf_id is None:
if workflow_list == []:
raise WorkflowException(_(u'No workflows found.'))
......@@ -169,6 +170,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
if wf.getPortalType() == 'Workflow':
# workflow compatibility
action = 'transition_' + action
else: action = action_ref
if wf.isActionSupported(ob, action, **kw):
found = 1
break
......
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