Index invoice and shipment state partially on their own state

Closes #13365
This commit is contained in:
Cédric Krier
2024-06-26 18:37:26 +02:00
parent f5d32c78b6
commit e8acbc6a8c
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -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'),
+4 -2
View File
@@ -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'),