details:   https://code.tryton.org/tryton/commit/725db2928033
branch:    6.0
user:      Cédric Krier <[email protected]>
date:      Thu Mar 26 09:09:00 2026 +0100
description:
        Calculate cached quantities for inactive locations when closing a stock 
period

        Closes #14664
        (grafted from 33b64863cfc720f5f65754f1898a93cf09419d63)
diffstat:

 modules/stock/period.py |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (17 lines):

diff -r b39410c1db54 -r 725db2928033 modules/stock/period.py
--- a/modules/stock/period.py   Tue Mar 24 16:57:31 2026 +0100
+++ b/modules/stock/period.py   Thu Mar 26 09:09:00 2026 +0100
@@ -115,9 +115,10 @@
             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)

Reply via email to