From c39db9af1a5e62dcc5a33d30282c2273b05a19d3 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 14 Oct 2008 14:14:47 +0200 Subject: [PATCH] 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 --- bin/osv/expression.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/osv/expression.py b/bin/osv/expression.py index 1e21443d7ab..7397a82e88b 100644 --- a/bin/osv/expression.py +++ b/bin/osv/expression.py @@ -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':