summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2012-11-29 17:42:53 +0100
committerThibault Delavallée <tde@openerp.com>2012-11-29 17:42:53 +0100
commita5ca416f055871fb2765567c2cf2f06445c1d2ca (patch)
tree422a67a632415f71450d3814355448d6efb03300 /addons/web/static/src
parent0de15c9bbf84e86cafa84c7ab025f853e4d987d1 (diff)
[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
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/chrome.js12
1 files 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;