From 534cc0cdad9771bbf247d23318b37067e4ee32f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 30 Oct 2008 15:59:30 +0100 Subject: [PATCH] Fix add empty list on xxx2Many --- trytond/osv/fields.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trytond/osv/fields.py b/trytond/osv/fields.py index 69e9ce0ba5..b1afeb1e95 100644 --- a/trytond/osv/fields.py +++ b/trytond/osv/fields.py @@ -423,6 +423,8 @@ class One2Many(Column): ids = [act[1]] else: ids = list(act[1]) + if not ids: + continue cursor.execute('UPDATE "' + _table + '" ' \ 'SET "' + self._field + '" = %s ' \ 'WHERE id IN (' \ @@ -536,6 +538,8 @@ class Many2Many(Column): ids = [act[1]] else: ids = list(act[1]) + if not ids: + continue cursor.execute('SELECT "' + self.target + '" ' \ 'FROM "' + self._rel + '" ' \ 'WHERE ' + self.origin + ' = %s ' \