Files
design-themes/test_themes/models/ir_http.py
T

18 lines
574 B
Python
Raw Normal View History

2021-05-10 15:45:35 +02:00
# Part of Odoo. See LICENSE file for full copyright and licensing details.
2024-11-12 11:33:17 +00:00
from odoo import models, modules
2021-05-10 15:45:35 +02:00
from odoo.http import request
class IrHttp(models.AbstractModel):
_inherit = 'ir.http'
2021-05-10 15:45:35 +02:00
@classmethod
def _pre_dispatch(cls, rule, args):
2021-05-10 15:45:35 +02:00
# Allow public user to use `fw` query string in test mode to ease tests
force_website_id = request.httprequest.args.get('fw')
2024-11-12 11:33:17 +00:00
if modules.module.current_test and force_website_id:
2021-05-10 15:45:35 +02:00
request.env['website']._force_website(force_website_id)
super()._pre_dispatch(rule, args)