KERNEL: fix where calc for list index out of range when deleting false items

bzr revid: ced-1fa9970b0e09d025a10625a8d7def51644299041
This commit is contained in:
ced 2007-02-23 07:04:25 +00:00
parent 071fd71878
commit adc88a72dc
1 changed files with 4 additions and 3 deletions

View File

@ -1303,11 +1303,12 @@ class orm(object):
qu1.append('(%s.%s %s %s)' % (table._table, x[0], x1, table._columns[x[0]]._symbol_set[0]))
elif x[1]=='in':
if len(x[2])>0:
todel = False
todel = []
for xitem in range(len(x[2])):
if x[2][xitem]==False and isinstance(x[2][xitem],bool):
todel = xitem
del x[2][xitem]
todel.append(xitem)
for xitem in todel[::-1]:
del x[2][xitem]
if x[0]=='id':
qu1.append('(id=any(array[%s]))' % (','.join(['%d'] * len(x[2])),))
else: