From 0b8264919787af5a08ac9aa7759ae77921a47deb Mon Sep 17 00:00:00 2001 From: "Krzysztof Magusiak (krma)" Date: Tue, 12 Nov 2024 11:33:17 +0000 Subject: [PATCH] [IMP] core: tools.config.is_testing flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flag to check whether Odoo was started in test mode. task-4270485 closes odoo/design-themes#1009 Related: odoo/odoo#186924 Related: odoo/enterprise#73654 Signed-off-by: Xavier Dollé (xdo) --- test_themes/models/ir_http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_themes/models/ir_http.py b/test_themes/models/ir_http.py index 97025a4e9..7306cea64 100644 --- a/test_themes/models/ir_http.py +++ b/test_themes/models/ir_http.py @@ -1,6 +1,6 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import models, tools +from odoo import models, modules from odoo.http import request @@ -11,7 +11,7 @@ class IrHttp(models.AbstractModel): def _pre_dispatch(cls, rule, args): # Allow public user to use `fw` query string in test mode to ease tests force_website_id = request.httprequest.args.get('fw') - if (request.registry.in_test_mode() or tools.config.options['test_enable']) and force_website_id: + if modules.module.current_test and force_website_id: request.env['website']._force_website(force_website_id) super()._pre_dispatch(rule, args)