From 5d952d1b1975a0d35eac612e2d1622def28be330 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Thu, 24 Dec 2009 13:01:46 +0000
Subject: [PATCH] store related solver decisions in a simulation movement's
 solver category.

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

diff --git a/product/ERP5/Document/SolverProcess.py b/product/ERP5/Document/SolverProcess.py
index a7c9f693d21..7654dc0566f 100644
--- a/product/ERP5/Document/SolverProcess.py
+++ b/product/ERP5/Document/SolverProcess.py
@@ -178,7 +178,6 @@ class SolverProcess(XMLObject, ActiveProcess):
     solver_decision_dict = {}
     for movement in movement_list:
       for simulation_movement in movement.getDeliveryRelatedValueList():
-        simulation_movemet_url = simulation_movement.getRelativeUrl()
         for divergence_tester in simulation_movement.getParentValue().getSpecialiseValue()._getDivergenceTesterList(exclude_quantity=False):
           if divergence_tester.compare(simulation_movement, movement):
             continue
@@ -187,7 +186,7 @@ class SolverProcess(XMLObject, ActiveProcess):
           application_list.sort()
           solver_decision_key = (divergence_tester.getRelativeUrl(), tuple(application_list))
           movement_dict = solver_decision_dict.setdefault(solver_decision_key, {})
-          movement_dict[simulation_movemet_url] = None
+          movement_dict[simulation_movement] = None
 
     # Now build the solver decision instances based on the previous
     # grouping
@@ -196,6 +195,8 @@ class SolverProcess(XMLObject, ActiveProcess):
       new_decision = self.newContent(portal_type='Solver Decision')
       new_decision._setDeliveryList(solver_decision_key[1])
       new_decision._setCausality(solver_decision_key[0])
+      for simulation_movement in movement_dict.keys():
+        simulation_movement.setSolverValue(new_decision)
       # No need to set application_list or....?
 
   def _generateRandomId(self):
-- 
2.30.9