diff --git a/product/ERP5/InteractionWorkflow.py b/product/ERP5/InteractionWorkflow.py index 914a630a06108a17adad22f0f633f24d9ef8b81c..b278f9e3f0ed32bf90ff66323dcaf5b8991ab476 100644 --- a/product/ERP5/InteractionWorkflow.py +++ b/product/ERP5/InteractionWorkflow.py @@ -178,12 +178,11 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject): NOTE: this method is not used in ERP5 because of transition_list approach ''' - for t in self.interactions.values(): - if t.trigger_type == TRIGGER_WORKFLOW_METHOD: - if method_id in t.method_id: - if ((t.portal_type_filter is None or ob.getPortalType() in t.portal_type_filter) - and self._checkTransitionGuard(t, ob)): - return 1 + tdef = self.interactions.get(method_id, None) + if (tdef is not None and + tdef.trigger_type == TRIGGER_WORKFLOW_METHOD and + self._checkTransitionGuard(tdef, ob)): + return 1 return 0