From e8acbc6a8ca64550e83a3a37b813ef3c0273536e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 26 Jun 2024 18:37:26 +0200 Subject: [PATCH] Index invoice and shipment state partially on their own state Closes #13365 --- modules/purchase/purchase.py | 6 ++++-- modules/sale/sale.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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'),