From f624e950bc05b0e2464e06ea4d2059c750e38dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 26 Mar 2026 09:09:00 +0100 Subject: [PATCH] Calculate cached quantities for inactive locations when closing a stock period Closes #14664 (grafted from 33b64863cfc720f5f65754f1898a93cf09419d63) --HG-- branch : 6.0 --- modules/stock/period.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/stock/period.py b/modules/stock/period.py index 5ad07bb4fb..87bbdd944b 100644 --- a/modules/stock/period.py +++ b/modules/stock/period.py @@ -115,9 +115,10 @@ class Period(Workflow, ModelSQL, ModelView): with connection.cursor() as cursor: cursor.execute(*query) - locations = Location.search([ - ('type', 'not in', ['warehouse', 'view']), - ], order=[]) + with Transaction().set_context(active_test=False): + locations = Location.search([ + ('type', 'not in', ['warehouse', 'view']), + ], order=[]) today = Date.today() recent_date = max(period.date for period in periods)