Calculate cached quantities for inactive locations when closing a stock period

Closes #14664
(grafted from 33b64863cfc720f5f65754f1898a93cf09419d63)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier
2026-03-26 09:09:00 +01:00
parent 32f4f067d0
commit f624e950bc
+4 -3
View File
@@ -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)