From c07a38046ba1dd67d27c6331223d306173e5c7f1 Mon Sep 17 00:00:00 2001 From: Kazuhiko Shiozaki <kazuhiko@nexedi.com> Date: Tue, 23 Mar 2010 11:06:03 +0000 Subject: [PATCH] * no need to propagate changes to upper level. * adopt only for trade model related movements. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33997 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/TradeModelSolver.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/product/ERP5/Document/TradeModelSolver.py b/product/ERP5/Document/TradeModelSolver.py index 594dbd5afc..c6bf8e6d65 100644 --- a/product/ERP5/Document/TradeModelSolver.py +++ b/product/ERP5/Document/TradeModelSolver.py @@ -57,9 +57,8 @@ class TradeModelSolver(AcceptSolver): # ISolver Implementation def solve(self): """ - Adopt new quantity to simulation movements, with keeping the - original one recorded, and then update Trade Model related lines - accordingly. + Adopt new values to simulation movements, with keeping the original + one recorded, and then update Trade Model related lines accordingly. """ configuration_dict = self.getConfigurationPropertyDict() portal_type = self.getPortalObject().portal_types[self.getPortalType()] @@ -98,11 +97,14 @@ class TradeModelSolver(AcceptSolver): value_dict.update({'quantity':new_quantity}) else: value_dict.update({solved_property:new_value}) - self._solveRecursively(simulation_movement, value_dict) + for property_id, value in value_dict.iteritems(): + if not simulation_movement.isPropertyRecorded(property_id): + simulation_movement.recordProperty(property_id) + simulation_movement.setMappedProperty(property_id, value) simulation_movement.expand() # Third, adopt changes on trade model related lines. - for movement in self.getDeliveryValueList(): + for movement in trade_model_related_movement_list: for solved_property in solved_property_list: if solved_property == 'quantity': total_quantity = sum( -- 2.30.9