summaryrefslogtreecommitdiff
path: root/openerp/osv/expression.py
diff options
context:
space:
mode:
Diffstat (limited to 'openerp/osv/expression.py')
-rw-r--r--openerp/osv/expression.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/openerp/osv/expression.py b/openerp/osv/expression.py
index e111842ded5..7c961760ec4 100644
--- a/openerp/osv/expression.py
+++ b/openerp/osv/expression.py
@@ -1221,7 +1221,7 @@ class expression(object):
else: # Must not happen
raise ValueError("Invalid domain term %r" % (leaf,))
- elif right == False and (left in model._columns) and model._columns[left]._type == "boolean" and (operator == '='):
+ elif (left in model._columns) and model._columns[left]._type == "boolean" and ((operator == '=' and right is False) or (operator == '!=' and right is True)):
query = '(%s."%s" IS NULL or %s."%s" = false )' % (table_alias, left, table_alias, left)
params = []
@@ -1229,7 +1229,7 @@ class expression(object):
query = '%s."%s" IS NULL ' % (table_alias, left)
params = []
- elif right == False and (left in model._columns) and model._columns[left]._type == "boolean" and (operator == '!='):
+ elif (left in model._columns) and model._columns[left]._type == "boolean" and ((operator == '!=' and right is False) or (operator == '==' and right is True)):
query = '(%s."%s" IS NOT NULL and %s."%s" != false)' % (table_alias, left, table_alias, left)
params = []