[FIX] M2M : values filtering on set()

lp bug: https://launchpad.net/bugs/480301 fixed

bzr revid: jvo@tinyerp.com-20091111055028-lza87cnyffvwxy4i
This commit is contained in:
Jay (Open ERP) 2009-11-11 11:20:28 +05:30
parent 89dc28dfe7
commit c36ff651f2
1 changed files with 2 additions and 0 deletions

View File

@ -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))