Files
odoo_source/addons/base_setup/models/ir_http.py
T
Simon Genin (ges) 28aabf0f69 [FIX] web, base_setup: show_effect param is always a boolean
The show_effect was either "True" or false which is inconsistent.
This was caused by the fact that the string value came from the backend
and the boolean came from the default value of get_param.

By wrapping the result of get_param in a bool constructor, we make sure
the type is always consistent.

closes odoo/odoo#78742

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-28 09:17:34 +00:00

15 lines
497 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.http import request
class IrHttp(models.AbstractModel):
_inherit = 'ir.http'
def session_info(self):
result = super(IrHttp, self).session_info()
if request.env.user.has_group('base.group_user'):
result['show_effect'] = bool(request.env['ir.config_parameter'].sudo().get_param('base_setup.show_effect'))
return result