From b323175cb4f7f1fcd8565aedfed28d518f695110 Mon Sep 17 00:00:00 2001 From: Robin Baumgartner Date: Mon, 24 Nov 2014 14:02:39 +0100 Subject: [PATCH] Use Null constant from python-sql for comparisons issue4143 review13701003 --- setup.py | 2 +- work.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index fab20a58ee..936c043164 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ if minor_version % 2: 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( name[8:], name, version)) -requires = ['python-sql'] +requires = ['python-sql>0.4'] for dep in info.get('depends', []): if not re.match(r'(ir|res|webdav)(\W|$)', dep): requires.append(get_require_version('trytond_%s' % dep)) diff --git a/work.py b/work.py index 7f444018a3..1342eb4455 100644 --- a/work.py +++ b/work.py @@ -2,6 +2,8 @@ #this repository contains the full copyright notices and license terms. from itertools import groupby from decimal import Decimal + +from sql import Null from sql.aggregate import Sum from trytond.model import ModelView, fields @@ -190,9 +192,9 @@ class Work: for sub_ids in grouped_slice(ids): red_sql = reduce_ids(line.work, sub_ids) if invoiced: - where = line.invoice_line != None + where = line.invoice_line != Null else: - where = line.invoice_line == None + where = line.invoice_line == Null cursor.execute(*line.select(line.work, Sum(line.hours), where=red_sql & where, group_by=line.work))