diff options
| author | Christophe Simonis <chs@openerp.com> | 2013-06-13 19:39:00 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2013-06-13 19:39:00 +0200 |
| commit | a61e7cb0c80ae773cab9753bd8a4e7e888bbf415 (patch) | |
| tree | 019a235869a5e087055700895d4584c80e2f9afb /addons/web/static/src/js/chrome.js | |
| parent | 5ed0ac2614b9430e61dae472d657a21c037d6ee9 (diff) | |
| parent | 180e6e41d81e28df43b41e3cb6131225d4169a28 (diff) | |
[MERGE] forward port of branch saas-1 up to revid 4887 chs@openerp.com-20130612153934-qyp6pb3bc4za4taf
bzr revid: chs@openerp.com-20130613172414-dln3g4j0ykcwaa02
bzr revid: chs@openerp.com-20130613173900-xl7rh321nnw2b04b
Diffstat (limited to 'addons/web/static/src/js/chrome.js')
| -rw-r--r-- | addons/web/static/src/js/chrome.js | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 884dc41a9f9..0c73a9b8a3c 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -430,7 +430,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({ var fetch_langs = this.rpc("/web/session/get_lang_list", {}).done(function(result) { self.lang_list = result; }); - return $.when(fetch_db, fetch_langs).done(self.do_render); + return $.when(fetch_db, fetch_langs).always(self.do_render); }, do_render: function() { var self = this; @@ -950,7 +950,7 @@ instance.web.Menu = instance.web.Widget.extend({ }, do_load_needaction: function (menu_ids) { var self = this; - menu_ids = _.reject(menu_ids, _.isEmpty); + menu_ids = _.compact(menu_ids); if (_.isEmpty(menu_ids)) { return $.when(); } @@ -1184,6 +1184,25 @@ instance.web.UserMenu = instance.web.Widget.extend({ }); } }, + on_menu_account: function() { + var self = this; + if (!this.getParent().has_uncommitted_changes()) { + var P = new instance.web.Model('ir.config_parameter'); + P.call('get_param', ['database.uuid']).then(function(dbuuid) { + var state = { + 'd': instance.session.db, + 'u': window.location.protocol + '//' + window.location.host, + }; + var params = { + response_type: 'token', + client_id: dbuuid || '', + state: JSON.stringify(state), + scope: 'userinfo', + }; + instance.web.redirect('https://accounts.openerp.com/oauth2/auth?'+$.param(params)); + }); + } + }, on_menu_about: function() { var self = this; self.rpc("/web/webclient/version_info", {}).done(function(res) { |
