mirror of
https://github.com/odoo/design-themes.git
synced 2025-10-07 01:18:52 +07:00
0b82649197
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) <xdo@odoo.com>
18 lines
574 B
Python
18 lines
574 B
Python
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models, modules
|
|
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 modules.module.current_test and force_website_id:
|
|
request.env['website']._force_website(force_website_id)
|
|
|
|
super()._pre_dispatch(rule, args)
|