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): ...@@ -161,6 +161,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
def doActionFor(self, ob, action, wf_id=None, *args, **kw): def doActionFor(self, ob, action, wf_id=None, *args, **kw):
workflow_list = self.getWorkflowValueListFor(ob.getPortalType()) workflow_list = self.getWorkflowValueListFor(ob.getPortalType())
action_ref = action
if wf_id is None: if wf_id is None:
if workflow_list == []: if workflow_list == []:
raise WorkflowException(_(u'No workflows found.')) raise WorkflowException(_(u'No workflows found.'))
...@@ -169,6 +170,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -169,6 +170,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
if wf.getPortalType() == 'Workflow': if wf.getPortalType() == 'Workflow':
# workflow compatibility # workflow compatibility
action = 'transition_' + action action = 'transition_' + action
else: action = action_ref
if wf.isActionSupported(ob, action, **kw): if wf.isActionSupported(ob, action, **kw):
found = 1 found = 1
break 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