From da522b772b690e0a5ab30d7962b5f5babb0aadd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 8 Apr 2009 17:22:05 +0200 Subject: [PATCH] Prevent to modify incoming_moves.add_remove for other database for issue953 --- purchase.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/purchase.py b/purchase.py index 069008a97b..edeea81f8b 100644 --- a/purchase.py +++ b/purchase.py @@ -7,6 +7,7 @@ from trytond.wizard import Wizard from trytond.backend import TableHandler from decimal import Decimal import datetime +import copy _STATES = { 'readonly': "state != 'draft'", @@ -1526,9 +1527,12 @@ class PackingIn(ModelSQL, ModelView): def __init__(self): super(PackingIn, self).__init__() - self.incoming_moves.add_remove = "[" + \ - self.incoming_moves.add_remove + ", " \ - "('supplier', '=', supplier)]" + self.incoming_moves = copy.copy(self.incoming_moves) + if "('supplier', '=', supplier)" not in self.incoming_moves.add_remove: + self.incoming_moves.add_remove = "[" + \ + self.incoming_moves.add_remove + ", " \ + "('supplier', '=', supplier)]" + self._reset_columns() self._error_messages.update({ 'reset_move': 'You cannot reset to draft a move generated '\