From 61c5987e26665f6614a62e58de69ba23d250309d Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Fri, 30 Sep 2005 07:22:09 +0000
Subject: [PATCH] make sure that an applied rule will be reindexed after
 expand, remove build

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

diff --git a/product/ERP5/Document/Delivery.py b/product/ERP5/Document/Delivery.py
index 03fbb14347..49863ea787 100755
--- a/product/ERP5/Document/Delivery.py
+++ b/product/ERP5/Document/Delivery.py
@@ -528,17 +528,12 @@ class Delivery(XMLObject):
       my_applied_rule = self.portal_simulation.get(applied_rule_id, None)
       if my_applied_rule is not None:
         my_applied_rule.expand(force=force, **kw)
+        # once expanded, the applied_rule must be reindexed
+        # because some simulation_movement may change even
+        # if there are not edited (acquisition)
+        my_applied_rule.activate().recursiveReindexObject()
       else:
         LOG("ERP5 Error:", 100,
             "Could not expand applied rule %s for delivery %s" %\
                 (applied_rule_id, self.getId()))
 
-    security.declareProtected(Permissions.ModifyPortalContent, 'build')
-    def build(self, builder_id):
-      """
-      Call the build method on the coressponding builder
-      """
-      builder = getToolByName(self,'portal_deliveries')[builder_id]
-      applied_rule = self.getCausalityRelatedValue(portal_type='Applied Rule')
-      builder.build(applied_rule_uid=applied_rule.getUid())
-
-- 
2.30.9