From 1339a52dc2a4abf7dd7f1e1069ab4fc89e81133f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 4 Sep 2008 18:22:35 +0200 Subject: [PATCH] Fix = False for boolean to not use is NULL --- trytond/osv/orm.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py index 49b110c0ea..db4bf79d33 100644 --- a/trytond/osv/orm.py +++ b/trytond/osv/orm.py @@ -2399,8 +2399,12 @@ class ORM(object): qu1.append(' false') else: if (arg[2] is False) and (arg[1] == '='): - qu1.append('(%s.%s IS NULL)' % \ - (table._table, arg[0])) + if table._columns[arg[0]]._type == 'boolean': + qu1.append('(%s.%s = false)' % \ + (table._table, arg[0])) + else: + qu1.append('(%s.%s IS NULL)' % \ + (table._table, arg[0])) elif (arg[2] is False) and (arg[1] == '<>' or arg[1] == '!='): qu1.append('(%s.%s IS NOT NULL)' % \ (table._table, arg[0]))