From 1ab3904fe80254b721df0b2b159433efdbb9f411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roc=C3=ADo=20Vega?= Date: Fri, 18 Sep 2026 12:29:25 +0000 Subject: [PATCH] [FIX] account_multi_store: keep active_test on data load with tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AccountJournal._search only forces active_test=False when it is not loading module data with tests enabled - Do not mutate the caller domain list in _search Change note: Ajuste interno en la carga de datos de los diarios durante las pruebas automáticas. No cambia el comportamiento del sistema para los usuarios. --- account_multi_store/models/account_journal.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/account_multi_store/models/account_journal.py b/account_multi_store/models/account_journal.py index 5d7e456d..a5fe97fc 100644 --- a/account_multi_store/models/account_journal.py +++ b/account_multi_store/models/account_journal.py @@ -3,6 +3,7 @@ # directory ############################################################################## from odoo import api, fields, models +from odoo.tools import config class AccountJournal(models.Model): @@ -27,8 +28,10 @@ def _search(self, domain, offset=0, limit=None, order=None): user = self.env.user # if superadmin, do not apply if not self.env.is_superuser(): - domain += ["|", ("store_id", "=", False), ("store_id", "child_of", user.store_ids.ids)] - return super(AccountJournal, self.with_context(active_test=False))._search(domain, offset, limit, order) + domain = domain + ["|", ("store_id", "=", False), ("store_id", "child_of", user.store_ids.ids)] + if not config["test_enable"]: + self = self.with_context(active_test=False) + return super(AccountJournal, self)._search(domain, offset, limit, order) @api.model @api.readonly