Use Null constant from python-sql for comparisons
issue4143 review13701003
This commit is contained in:
1 parent
49a2aacd8e
commit
b323175cb4
2 files changed
+5
-3
No files matched your search
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user