From ea3b22bb89394055bd11983e619de22ca2f61ba8 Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Tue, 22 Sep 2009 15:49:24 +0000
Subject: [PATCH] Do not modify a container while iterating on it

objectValues does not always return a list. When it is called without any
parameter, a LazyMap object is returned and objects must not be deleted while
iterating on it: otherwise, objectValues may not return all objects.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29140 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/SimulationMovement.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/product/ERP5/Document/SimulationMovement.py b/product/ERP5/Document/SimulationMovement.py
index 82f72a29ab..1cec277a72 100644
--- a/product/ERP5/Document/SimulationMovement.py
+++ b/product/ERP5/Document/SimulationMovement.py
@@ -266,7 +266,7 @@ class SimulationMovement(Movement):
       if ref and ref not in applicable_rule_dict:
         applicable_rule_dict[ref] = rule
 
-    for applied_rule in self.objectValues():
+    for applied_rule in list(self.objectValues()):
       rule = applied_rule.getSpecialiseValue()
       if not applied_rule._isTreeDelivered() and not rule.test(self):
         self._delObject(applied_rule.getId())
-- 
2.30.9