From c216cc3e5f5d1edafb946c8ddfa50344313c5f65 Mon Sep 17 00:00:00 2001 From: Sylvain Calador Date: Tue, 22 Sep 2015 11:07:27 +0200 Subject: [PATCH] [REF] Use get_param() instead of search_read() to get the configuration parameter --- web_environment_ribbon/static/src/js/ribbon.js | 11 +++++------ web_environment_ribbon/view/base_view.xml | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/web_environment_ribbon/static/src/js/ribbon.js b/web_environment_ribbon/static/src/js/ribbon.js index 6613bf45..48848fc8 100644 --- a/web_environment_ribbon/static/src/js/ribbon.js +++ b/web_environment_ribbon/static/src/js/ribbon.js @@ -22,13 +22,12 @@ openerp.web_environment_ribbon = function(instance) { ribbon.hide(); var model = new instance.web.Model('ir.config_parameter'); - var query = [['key', '=', 'ribbon.name']]; - var fields = ['value']; + var key = 'ribbon.name'; - var res = model.call('search_read', [query, fields]).then( - function (result) { - if (result.length) { - ribbon.html(result[0].value); + var res = model.call('get_param', [key]).then( + function (name) { + if (name && name != 'False') { + ribbon.html(name); ribbon.show(); } } diff --git a/web_environment_ribbon/view/base_view.xml b/web_environment_ribbon/view/base_view.xml index 62896be8..6d9efc9c 100644 --- a/web_environment_ribbon/view/base_view.xml +++ b/web_environment_ribbon/view/base_view.xml @@ -13,10 +13,9 @@ -