From e6aac13ff1fa7b851a8510bd1a59614873ccb90c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Mon, 10 Sep 2007 12:00:42 +0000
Subject: [PATCH] reindex in notifyWorkflowMethod, so that only standard
 workflow method reindex, and not interactions.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16220 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Base.py                 | 3 ---
 product/ERP5Type/patches/WorkflowTool.py | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index 40dd9b9326..8c11879d8b 100644
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -205,9 +205,6 @@ class WorkflowMethod(Method):
       except ObjectMoved, ex:
         # Re-raise with a different result.
         raise ObjectMoved(ex.getNewObject(), result)
-      else:
-        if getattr(aq_base(instance), 'reindexObject', None) is not None:
-          instance.reindexObject()
 
     # Call whatever must be called after changing states
     for wf_id, transition_list in valid_transition_item_list:
diff --git a/product/ERP5Type/patches/WorkflowTool.py b/product/ERP5Type/patches/WorkflowTool.py
index 951c6e1f18..5612cde205 100644
--- a/product/ERP5Type/patches/WorkflowTool.py
+++ b/product/ERP5Type/patches/WorkflowTool.py
@@ -46,6 +46,8 @@ def DCWorkflowDefinition_notifyWorkflowMethod(self, ob, method_id, args=None, kw
     if not self._checkTransitionGuard(tdef, ob):
         raise Unauthorized(method_id)
     self._changeStateOf(ob, tdef)
+    if getattr(ob, 'reindexObject', None) is not None:
+        ob.reindexObject()
 
 def DCWorkflowDefinition_notifyBefore(self, ob, action, args=None, kw=None, transition_list=None):
     '''
-- 
2.30.9