[Fix] Bug 372706 : Domains for Booleans(False and Null) handled(ref:YSA)

bzr revid: jvo@tinyerp.com-20090511064416-3e5xw3r5unvqggej
This commit is contained in:
Jay (Open ERP) 2009-05-11 12:14:16 +05:30
parent 8469a69ec0
commit aeb27427ec
1 changed files with 6 additions and 2 deletions

View File

@ -254,8 +254,12 @@ class expression(object):
query = '(%s OR %s IS NULL)' % (query, left)
else:
params = []
if (((right == False) and (type(right)==bool)) or (right is None)) and (operator == '='):
query = '%s.%s IS NULL' % (table._table, left)
if right == False and table._columns[leaf[0]]._type=="boolean" and (operator == '='):
query = '%s.%s IS NULL or %s.%s = false ' % (table._table, left,table._table, left)
elif (((right == False) and (type(right)==bool)) or (right is None)) and (operator == '='):
query = '%s.%s IS NULL ' % (table._table, left)
elif right == False and table._columns[leaf[0]]._type=="boolean" and (operator in ['<>', '!=']):
query = '%s.%s IS NOT NULL and %s.%s != false' % (table._table, left,table._table, left)
elif (((right == False) and (type(right)==bool)) or right is None) and (operator in ['<>', '!=']):
query = '%s.%s IS NOT NULL' % (table._table, left)
else: