diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 68493b36701..c6d216d128c 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -799,10 +799,18 @@ instance.web.client_actions.add("change_password", "instance.web.ChangePassword" instance.web.Menu = instance.web.Widget.extend({ template: 'Menu', init: function() { + var self = this; this._super.apply(this, arguments); this.has_been_loaded = $.Deferred(); this.maximum_visible_links = 'auto'; // # of menu to show. 0 = do not crop, 'auto' = algo this.data = {data:{children:[]}}; + this.on("menu_loaded", this, function (e) { + // launch the fetch of needaction counters, asynchronous + this.rpc("/web/menu/load_needaction", {menu_ids: false}).done(function(r) { + self.on_needaction_loaded(r); + }); + }); + }, start: function() { this._super.apply(this, arguments); @@ -835,10 +843,6 @@ instance.web.Menu = instance.web.Widget.extend({ } this.trigger('menu_loaded', data); this.has_been_loaded.resolve(); - // Now launch the fetch of needaction counters, asynchronous - this.rpc("web/menu/load_needaction", {menu_ids: false}).done(function(r) { - self.on_needaction_loaded(r); - }); }, on_needaction_loaded: function(data) { var self = this;