From 72be5165f4055cc81d547e91e7a246b3131b8baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 9 Jul 2009 08:35:05 +0200 Subject: [PATCH] Fix dictionary changed size during iteration --- trytond/ir/action.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/trytond/ir/action.py b/trytond/ir/action.py index 5cc0b98997..fee15fe7f2 100644 --- a/trytond/ir/action.py +++ b/trytond/ir/action.py @@ -333,7 +333,8 @@ class ActionReport(ModelSQL, ModelView): if field in self._columns \ and hasattr(self._columns[field], 'set'): later[field] = vals[field] - del vals[field] + for field in later: + del vals[field] if cursor.nextid(self._table): cursor.setnextid(self._table, cursor.currid('ir_action')) new_id = super(ActionReport, self).create(cursor, user, vals, @@ -434,7 +435,8 @@ class ActionActWindow(ModelSQL, ModelView): if field in self._columns \ and hasattr(self._columns[field], 'set'): later[field] = vals[field] - del vals[field] + for field in later: + del vals[field] if cursor.nextid(self._table): cursor.setnextid(self._table, cursor.currid('ir_action')) new_id = super(ActionActWindow, self).create(cursor, user, vals, @@ -507,7 +509,8 @@ class ActionWizard(ModelSQL, ModelView): if field in self._columns \ and hasattr(self._columns[field], 'set'): later[field] = vals[field] - del vals[field] + for field in later: + del vals[field] if cursor.nextid(self._table): cursor.setnextid(self._table, cursor.currid('ir_action')) new_id = super(ActionWizard, self).create(cursor, user, vals, @@ -650,7 +653,8 @@ class ActionURL(ModelSQL, ModelView): if field in self._columns \ and hasattr(self._columns[field], 'set'): later[field] = vals[field] - del vals[field] + for field in later: + del vals[field] if cursor.nextid(self._table): cursor.setnextid(self._table, cursor.currid('ir_action')) new_id = super(ActionURL, self).create(cursor, user, vals,