From d0ca2d115e8b40308e1ff83bf9e7cc874762fbff Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Tue, 22 Nov 2016 12:04:09 +0100 Subject: [REF] ir_config_parameter: remove `group_ids` and simplify Add `sudo()` to call `get_param` where necessary, and make the web client use a controller instead of directly accessing parameters. --- addons/web/static/src/js/widgets/user_menu.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/widgets/user_menu.js b/addons/web/static/src/js/widgets/user_menu.js index 3c65ab3ac49..d1cd0eb842b 100644 --- a/addons/web/static/src/js/widgets/user_menu.js +++ b/addons/web/static/src/js/widgets/user_menu.js @@ -58,21 +58,11 @@ var UserMenu = Widget.extend({ }); }, on_menu_account: function() { + var self = this; this.trigger_up('clear_uncommitted_changes', { callback: function() { - var P = new Model('ir.config_parameter'); - P.call('get_param', ['database.uuid']).then(function(dbuuid) { - var state = { - 'd': session.db, - 'u': window.location.protocol + '//' + window.location.host, - }; - var params = { - response_type: 'token', - client_id: dbuuid || '', - state: JSON.stringify(state), - scope: 'userinfo', - }; - framework.redirect('https://accounts.odoo.com/oauth2/auth?'+$.param(params)); + self.rpc('/web/session/account').then(function(url) { + framework.redirect(url); }).fail(function(result, ev){ ev.preventDefault(); framework.redirect('https://accounts.odoo.com/account'); -- cgit v1.2.3