From e17a1f6c46ddc7ca57c82a2fcaa5c521fa527d49 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Mon, 5 Jul 2010 08:45:15 +0000
Subject: [PATCH] use more accurate comparison to match with existing Solver
 Decision documents.

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

diff --git a/product/ERP5/Document/SolverProcess.py b/product/ERP5/Document/SolverProcess.py
index 89fe4cde26..92296a6889 100644
--- a/product/ERP5/Document/SolverProcess.py
+++ b/product/ERP5/Document/SolverProcess.py
@@ -241,15 +241,17 @@ class SolverProcess(XMLObject, ActiveProcess):
     solver_decision_list = self.objectValues(portal_type='Solver Decision')
     for solver_decision_key, movement_dict in solver_decision_dict.items():
       causality, delivery_list, solver_list = solver_decision_key
+      movement_url_list = [x.getRelativeUrl() for x in movement_dict.keys()]
+      movement_url_list.sort()
       matched_solver_decision_list = [
         x for x in solver_decision_list \
-        if x.getDeliveryValueList() == movement_dict.keys() and \
+        if sorted(x.getDeliveryList()) == movement_url_list and \
         x.getCausality() == causality]
       if len(matched_solver_decision_list) > 0:
         solver_decision_list.remove(matched_solver_decision_list[0])
       else:
         new_decision = self.newContent(portal_type='Solver Decision')
-        new_decision._setDeliveryValueList(movement_dict.keys())
+        new_decision._setDeliveryList(movement_url_list)
         new_decision._setCausality(solver_decision_key[0])
         # If we have only one available automatic solver, we just use it
         # automatically.
-- 
2.30.9