Don't modify input values

bzr revid: ced-f4ed2e94484d7742129c3df624172931d106e4a1
This commit is contained in:
ced 2007-08-31 11:03:12 +00:00
parent 7888751245
commit 0edf7751fd
1 changed files with 6 additions and 4 deletions

View File

@ -385,10 +385,12 @@ class one2many(_column):
elif act[0]==5:
cr.execute('update '+_table+' set '+self._fields_id+'=null where '+self._fields_id+'=%d', (id,))
elif act[0]==6:
if not len(act[2]):
act[2] = [0]
cr.execute('update '+_table+' set '+self._fields_id+'=NULL where '+self._fields_id+'=%d and id not in ('+','.join(map(str, act[2]))+')', (id,))
if len(act[2]):
if not act[2]:
ids2 = [0]
else:
ids2 = act[2]
cr.execute('update '+_table+' set '+self._fields_id+'=NULL where '+self._fields_id+'=%d and id not in ('+','.join(map(str, ids2))+')', (id,))
if act[2]:
cr.execute('update '+_table+' set '+self._fields_id+'=%d where id in ('+','.join(map(str, act[2]))+')', (id,))
def search(self, cr, obj, args, name, value, offset=0, limit=None, uid=None, operator='like'):
return obj.pool.get(self._obj).name_search(cr, uid, value, self._domain, offset, limit)