domains: allow None to be passed as right operand of a leaf (produce a IS NULL sql statement)

bzr revid: christophe@tinyerp.com-20081014121447-imaosx152kodnwpd
This commit is contained in:
Christophe Simonis 2008-10-14 14:14:47 +02:00
parent 0b13461114
commit c39db9af1a
1 changed files with 2 additions and 2 deletions

View File

@ -232,9 +232,9 @@ class expression(object):
query = '(%s OR %s IS NULL)' % (query, left)
else:
params = []
if right is False and operator == '=':
if (right == False or right is None) and operator == '=':
query = '%s IS NULL' % left
elif right is False and operator in ['<>', '!=']:
elif (right == False or right is None) and operator in ['<>', '!=']:
query = '%s IS NOT NULL' % left
else:
if left == 'id':