From 80d978d7f3b3060a916133ea6fd8fecbda68baa4 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Thu, 9 Oct 2008 14:53:13 +0000
Subject: [PATCH] propagate activate_kw to simulation_movement reindexing
 activities when we call build with activate_kw

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24124 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/DeliveryBuilder.py | 8 +++++---
 product/ERP5/Document/OrderBuilder.py    | 4 ++--
 product/ERP5/MovementGroup.py            | 5 ++++-
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/product/ERP5/Document/DeliveryBuilder.py b/product/ERP5/Document/DeliveryBuilder.py
index 60e739d3ab..5c283a8c2d 100644
--- a/product/ERP5/Document/DeliveryBuilder.py
+++ b/product/ERP5/Document/DeliveryBuilder.py
@@ -144,7 +144,7 @@ class DeliveryBuilder(OrderBuilder):
   def _setDeliveryMovementProperties(self, delivery_movement,
                                      simulation_movement, property_dict,
                                      update_existing_movement=0,
-                                     force_update=0):
+                                     force_update=0, activate_kw=None):
     """
       Initialize or update delivery movement properties.
       Set delivery ratio on simulation movement.
@@ -155,8 +155,10 @@ class DeliveryBuilder(OrderBuilder):
                             self, delivery_movement,
                             simulation_movement, property_dict,
                             update_existing_movement=update_existing_movement,
-                            force_update=force_update)
-    simulation_movement.edit(delivery_value=delivery_movement)
+                            force_update=force_update, 
+                            activate_kw=activate_kw)
+    simulation_movement.edit(delivery_value=delivery_movement,
+                             activate_kw=activate_kw)
 
   # Simulation consistency propagation
   security.declareProtected(Permissions.ModifyPortalContent,
diff --git a/product/ERP5/Document/OrderBuilder.py b/product/ERP5/Document/OrderBuilder.py
index 19a21c025d..ac07afb6b9 100644
--- a/product/ERP5/Document/OrderBuilder.py
+++ b/product/ERP5/Document/OrderBuilder.py
@@ -629,12 +629,12 @@ class OrderBuilder(XMLObject, Amount, Predicate):
         self._setDeliveryMovementProperties(
                             object_to_update, movement, property_dict,
                             update_existing_movement=update_existing_movement,
-                            force_update=force_update)
+                            force_update=force_update, activate_kw=activate_kw)
 
   def _setDeliveryMovementProperties(self, delivery_movement,
                                      simulation_movement, property_dict,
                                      update_existing_movement=0,
-                                     force_update=0):
+                                     force_update=0, activate_kw=None):
     """
       Initialize or update delivery movement properties.
       Set delivery ratio on simulation movement.
diff --git a/product/ERP5/MovementGroup.py b/product/ERP5/MovementGroup.py
index 928e45bdc0..8b6cd4e2f4 100644
--- a/product/ERP5/MovementGroup.py
+++ b/product/ERP5/MovementGroup.py
@@ -466,10 +466,13 @@ class FakeMovement:
     return self.__movement_list[0].getVariationCategoryList(
         omit_optional_variation=omit_optional_variation, **kw)
 
-  def edit(self, **kw):
+  def edit(self, activate_kw=None, **kw):
     """
       Written in order to call edit in delivery builder,
       as it is the generic way to modify object.
+
+      activate_kw is here for compatibility reason with Base.edit,
+      it will not be used here.
     """
     for key in kw.keys():
       if key == 'delivery_ratio':
-- 
2.30.9