From a39334aee9e98e7ea8f912fdf32e1366c52f6fba Mon Sep 17 00:00:00 2001
From: Wenjie Zheng <wenjie.zheng@tiolive.com>
Date: Wed, 6 May 2015 23:12:02 +0000
Subject: [PATCH] ERP5WorkflowTool.py: make universal method return a correct
 workflow list for a portal type.

---
 product/ERP5/Tool/ERP5WorkflowTool.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/product/ERP5/Tool/ERP5WorkflowTool.py b/product/ERP5/Tool/ERP5WorkflowTool.py
index c890435863..b2576c17f0 100644
--- a/product/ERP5/Tool/ERP5WorkflowTool.py
+++ b/product/ERP5/Tool/ERP5WorkflowTool.py
@@ -246,15 +246,13 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
     """
     portal_type = self.getPortalObject().getDefaultModule(portal_type="portal_types")._getOb(portal_type_id, None)
     workflow_list = []
-    if portal_type is None:
-      return workflow_list
-    for workflow_id in portal_type.getTypeERP5WorkflowList():
-      workflow_list.append(self._getOb(workflow_id))
+    if portal_type is not None:
+      for workflow_id in portal_type.getTypeERP5WorkflowList():
+        workflow_list.append(self._getOb(workflow_id))
 
     for wf in self.getWorkflowsFor(portal_type_id):
       if wf is not None:
         workflow_list.append(wf)
-
     return workflow_list
 
   def dc_workflow_asERP5Object(self, container, dc_workflow, temp):
-- 
2.30.9