From 86f2cf22d0eb862172e709d93a05be4099ef5f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Jim=C3=A9nez?= Date: Tue, 21 Nov 2017 09:47:16 +0100 Subject: [PATCH] [FIX][11.0] web_environment_ribbon (#806) * [FIX] web_environment_ribbon: Fix to show the ribbon to every non-admin user * [FIX] web_environment_ribbon: Version number --- web_environment_ribbon/__manifest__.py | 2 +- .../models/web_environment_ribbon_backend.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/web_environment_ribbon/__manifest__.py b/web_environment_ribbon/__manifest__.py index 76a2c818eb75..0f1238c347af 100644 --- a/web_environment_ribbon/__manifest__.py +++ b/web_environment_ribbon/__manifest__.py @@ -6,7 +6,7 @@ { 'name': "Web Environment Ribbon", - 'version': '11.0.1.0.0', + 'version': '11.0.1.0.1', 'category': 'Web', 'author': 'Francesco OpenCode Apruzzese, ' 'Tecnativa, ' diff --git a/web_environment_ribbon/models/web_environment_ribbon_backend.py b/web_environment_ribbon/models/web_environment_ribbon_backend.py index 9f012290c9b9..114babc77880 100644 --- a/web_environment_ribbon/models/web_environment_ribbon_backend.py +++ b/web_environment_ribbon/models/web_environment_ribbon_backend.py @@ -17,7 +17,8 @@ def _prepare_ribbon_format_vals(self): @api.model def _prepare_ribbon_name(self): - name_tmpl = self.env['ir.config_parameter'].get_param('ribbon.name') + name_tmpl = self.env['ir.config_parameter'].sudo().get_param( + 'ribbon.name') vals = self._prepare_ribbon_format_vals() return name_tmpl.format(**vals) @@ -31,7 +32,7 @@ def get_environment_ribbon(self): name = self._prepare_ribbon_name() return { 'name': name, - 'color': ir_config_model.get_param('ribbon.color'), - 'background_color': ir_config_model.get_param( + 'color': ir_config_model.sudo().get_param('ribbon.color'), + 'background_color': ir_config_model.sudo().get_param( 'ribbon.background.color'), }