From d89ec5761748900f81dfd61a3a4b5fd1fbf97ebc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Fri, 9 Nov 2007 15:04:11 +0000
Subject: [PATCH] tell catalogObjectList to relaunch acitivity if inventory
 goes in an archive, because inventory computation depends on the catalog

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17495 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/Inventory.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/product/ERP5/Document/Inventory.py b/product/ERP5/Document/Inventory.py
index d7c3af62e4..b7685aca0c 100644
--- a/product/ERP5/Document/Inventory.py
+++ b/product/ERP5/Document/Inventory.py
@@ -294,11 +294,14 @@ class Inventory(Delivery):
 
     # Reindex objects
     object_list = [self]
+    immediate_reindex_archive = sql_catalog_id is None
     self.portal_catalog.catalogObjectList(object_list,
                                           sql_catalog_id = sql_catalog_id,
-                                          disable_archive=disable_archive)
-
+                                          disable_archive=disable_archive,
+                                          immediate_reindex_archive=immediate_reindex_archive)
+    
     self.portal_catalog.catalogObjectList(
            stock_object_list, method_id_list=('z_catalog_stock_list', ),
            sql_catalog_id = sql_catalog_id,
-           disable_cache=1, check_uid=0, disable_archive=disable_archive)
+           disable_cache=1, check_uid=0, disable_archive=disable_archive,
+           immediate_reindex_archive=immediate_reindex_archive)
-- 
2.30.9