From c58f13c8e91f193201dba08b63c19c16617870d6 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 22 Oct 2013 19:10:10 +0200 Subject: [PATCH] [FIX] im: do not search users before start polling. This avoid a race condition for im.user creation bzr revid: chs@openerp.com-20131022171010-ilfvqced6q8qta3h --- addons/im/static/src/js/im.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/addons/im/static/src/js/im.js b/addons/im/static/src/js/im.js index 6fbf452f974..f4b74adebf6 100644 --- a/addons/im/static/src/js/im.js +++ b/addons/im/static/src/js/im.js @@ -62,16 +62,12 @@ this.user_search_dm = new instance.web.DropMisordered(); }, start: function() { + var self = this; this.$el.css("right", -this.$el.outerWidth()); $(window).scroll(_.bind(this.calc_box, this)); $(window).resize(_.bind(this.calc_box, this)); this.calc_box(); - this.on("change:current_search", this, this.search_changed); - this.search_changed(); - - var self = this; - return this.c_manager.start_polling().then(function() { self.c_manager.on("new_conversation", self, function(conv) { conv.$el.droppable({ @@ -80,6 +76,7 @@ } }); }); + self.search_changed(); }); }, calc_box: function() { @@ -174,4 +171,4 @@ openerp.webclient.to_kitten(); }; -})(); \ No newline at end of file +})();