From a5ca416f055871fb2765567c2cf2f06445c1d2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 29 Nov 2012 17:42:53 +0100 Subject: [PATCH] [IMP] needaction counters: moved rpc call on the trigger menu_loaded, to be able to reload the needaction counters through this trigger. bzr revid: tde@openerp.com-20121129164253-j2vol27w0libpdsd --- addons/web/static/src/js/chrome.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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;