Files
design-themes/test_themes/models/ir_http.py
T
Gorash 2263661435 [IMP] orm/all: Make _name or _inherit mandatory
This is a request following the revert of the use of class names
(concerning the python inheritance and typing project)

closes odoo/design-themes#1024

Related: odoo/odoo#189889
Related: odoo/enterprise#75293
Signed-off-by: Raphael Collet <rco@odoo.com>
2024-12-27 22:02:38 +00:00

18 lines
617 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, tools
from odoo.http import request
class IrHttp(models.AbstractModel):
_inherit = 'ir.http'
@classmethod
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:
request.env['website']._force_website(force_website_id)
super()._pre_dispatch(rule, args)