From 5dfd892b1cd85e0d40bcf6c5d161bf833fc8bc39 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Mon, 30 May 2005 11:39:25 +0000
Subject: [PATCH] Modify build API in order to launch it in activity.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3115 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/DeliveryBuilder.py | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/product/ERP5/Document/DeliveryBuilder.py b/product/ERP5/Document/DeliveryBuilder.py
index 06e9c69af4..3bb671c35c 100755
--- a/product/ERP5/Document/DeliveryBuilder.py
+++ b/product/ERP5/Document/DeliveryBuilder.py
@@ -94,7 +94,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
                     , PropertySheet.DeliveryBuilder
                     )
 
-  def build(self, applied_rule=None):
+  def build(self, applied_rule_uid=None):
     """
       Build deliveries from a list of movements
 
@@ -103,7 +103,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
       or to Simulation Movements related to a limited set of existing
     """
     # Select
-    movement_list = self.selectMovement(applied_rule=applied_rule)
+    movement_list = self.selectMovement(applied_rule_uid=applied_rule_uid)
     # Collect
     root_group = self.collectMovement(movement_list)
     # Build
@@ -123,7 +123,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
       
     return delivery_list
 
-  def selectMovement(self, applied_rule=None):
+  def selectMovement(self, applied_rule_uid=None):
     """
       defines how to query all Simulation Movements which meet certain criteria
       (including the above path path definition).
@@ -136,10 +136,8 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
     # We only search Simulation Movement
     kw['portal_type'] = 'Simulation Movement'
     # Search only child movement from this applied rule
-    if applied_rule is not None:
-      # XXX Be sure that applied rule is well indexed
-      applied_rule.recursiveImmediateReindexObject()
-      kw['parent_uid'] = applied_rule.getUid()
+    if applied_rule_uid is not None:
+      kw['parent_uid'] = applied_rule_uid
     # XXX Add profile query
     # Add resource query
     if self.resource_portal_type not in ('', None):
-- 
2.30.9