From c36ff651f2ee97e7975e94e0361525cff9bc8e10 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 11 Nov 2009 11:20:28 +0530 Subject: [PATCH] [FIX] M2M : values filtering on set() lp bug: https://launchpad.net/bugs/480301 fixed bzr revid: jvo@tinyerp.com-20091111055028-lza87cnyffvwxy4i --- bin/osv/fields.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/osv/fields.py b/bin/osv/fields.py index cde2a0e8ff4..dc5e2a9fd4a 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -528,6 +528,8 @@ class many2many(_column): return obj = obj.pool.get(self._obj) for act in values: + if not (isinstance(act, list) or isinstance(act, tuple)) or not act: + continue if act[0] == 0: idnew = obj.create(cr, user, act[2]) cr.execute('insert into '+self._rel+' ('+self._id1+','+self._id2+') values (%s,%s)', (id, idnew))