Commit 91183a1d authored by Vincent Pelletier's avatar Vincent Pelletier

ERP5Type.patched.DCWorkflow: Factorise consecutive tests.

parent 530cc655
...@@ -209,6 +209,8 @@ def DCWorkflowDefinition_listGlobalActions(self, info): ...@@ -209,6 +209,8 @@ def DCWorkflowDefinition_listGlobalActions(self, info):
DCWorkflowDefinition.listGlobalActions = DCWorkflowDefinition_listGlobalActions DCWorkflowDefinition.listGlobalActions = DCWorkflowDefinition_listGlobalActions
# Patches over original listObjectActions:
# - Factorise consecutive tests.
def DCWorkflowDefinition_listObjectActions(self, info): def DCWorkflowDefinition_listObjectActions(self, info):
''' '''
Allows this workflow to Allows this workflow to
...@@ -224,9 +226,8 @@ def DCWorkflowDefinition_listObjectActions(self, info): ...@@ -224,9 +226,8 @@ def DCWorkflowDefinition_listObjectActions(self, info):
res = [] res = []
for tid in sdef.transitions: for tid in sdef.transitions:
tdef = self.transitions.get(tid, None) tdef = self.transitions.get(tid, None)
if tdef is not None and tdef.trigger_type == TRIGGER_USER_ACTION: if tdef is not None and tdef.trigger_type == TRIGGER_USER_ACTION and \
if tdef.actbox_name: tdef.actbox_name and self._checkTransitionGuard(tdef, ob):
if self._checkTransitionGuard(tdef, ob):
res.append((tid, { res.append((tid, {
'id': tid, 'id': tid,
'name': tdef.actbox_name % info, 'name': tdef.actbox_name % info,
......
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