From 3ca4615b32fb4c8580449dc543a22bd0ddb43ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 19 Jun 2024 12:44:33 +0200 Subject: [PATCH] Add location and use product range in stock period cache index The cache is always filtered by location and the product is often filtered with reduced ids. --- modules/stock/period.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/stock/period.py b/modules/stock/period.py index 64d8603a72..76c77f59b0 100644 --- a/modules/stock/period.py +++ b/modules/stock/period.py @@ -190,7 +190,8 @@ class Cache(ModelSQL, ModelView): Index( t, (t.period, Index.Equality()), - (t.product, Index.Equality()), + (t.location, Index.Range()), + (t.product, Index.Range()), include=[t.internal_quantity]), Index( t,