Fix: Operador And y total_amount_cache != None
This commit is contained in:
parent
8211278e78
commit
a4e9001bd6
6
sale.py
6
sale.py
@ -2,6 +2,7 @@
|
||||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from decimal import Decimal
|
||||
from sql.operators import And
|
||||
from sql.aggregate import Sum
|
||||
from sql.conditionals import Coalesce
|
||||
|
||||
@ -162,13 +163,14 @@ class Sale(metaclass=PoolMeta):
|
||||
condition=(sale.id == payline.sale)
|
||||
).select(
|
||||
sale.id,
|
||||
where=((sale.total_amount_cache) & (
|
||||
where=(And([
|
||||
sale.total_amount_cache != None,
|
||||
sale.state.in_([
|
||||
'draft',
|
||||
'quotation',
|
||||
'confirmed',
|
||||
'processing',
|
||||
'done']))),
|
||||
'done'])])),
|
||||
group_by=(sale.id),
|
||||
having=(Operator(
|
||||
sale.total_amount_cache - Sum(
|
||||
|
Loading…
Reference in New Issue
Block a user