diff --git a/modules/purchase/purchase.py b/modules/purchase/purchase.py index dd01368206..b9a3bc29b3 100644 --- a/modules/purchase/purchase.py +++ b/modules/purchase/purchase.py @@ -258,11 +258,13 @@ class Purchase( Index( t, (t.invoice_state, Index.Equality()), - where=t.state.in_(['none', 'waiting', 'exception'])), + where=t.invoice_state.in_([ + 'none', 'waiting', 'exception'])), Index( t, (t.shipment_state, Index.Equality()), - where=t.state.in_(['none', 'waiting', 'exception'])), + where=t.shipment_state.in_([ + 'none', 'waiting', 'exception'])), }) cls._order = [ ('purchase_date', 'DESC NULLS FIRST'), diff --git a/modules/sale/sale.py b/modules/sale/sale.py index b193e85ed5..307038bbf0 100644 --- a/modules/sale/sale.py +++ b/modules/sale/sale.py @@ -301,11 +301,13 @@ class Sale( Index( t, (t.invoice_state, Index.Equality()), - where=t.state.in_(['none', 'waiting', 'exception'])), + where=t.invoice_state.in_([ + 'none', 'waiting', 'exception'])), Index( t, (t.shipment_state, Index.Equality()), - where=t.state.in_(['none', 'waiting', 'exception'])), + where=t.shipment_state.in_([ + 'none', 'waiting', 'exception'])), }) cls._order = [ ('sale_date', 'DESC NULLS FIRST'),