From b82a3a2223c2c081b325902067dd2e9e8dbd032c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 11 Sep 2012 15:21:22 +0200 Subject: [PATCH] [FIX] Wall: fixed search not taken into account in the domain given to the displayed threads. bzr revid: tde@openerp.com-20120911132122-9w5d1jdk0br5khqs --- addons/mail/static/src/js/mail.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index a4be9456ab3..5a611de0a27 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -684,11 +684,8 @@ openerp.mail = function(session) { this.options.domain = options.domain || []; this.options.context = options.context || {}; this.options.thread_level = options.thread_level || 1; - this.thread_list = []; - this.ds_msg = new session.web.DataSetSearch(this, 'mail.message'); - // for search view - this.search = {'domain': [], 'context': {}, 'groupby': {}} this.search_results = {'domain': [], 'context': {}, 'groupby': {}} + this.ds_msg = new session.web.DataSetSearch(this, 'mail.message'); }, start: function () { @@ -699,7 +696,7 @@ openerp.mail = function(session) { }, destroy: function () { - for (var i in this.thread_list) { this.thread_list[i].destroy(); } + if (this.thread) this.thread.destroy(); this._super.apply(this, arguments); }, @@ -746,10 +743,11 @@ openerp.mail = function(session) { /** Display the Wall threads */ message_display: function () { + var thread_domain = this.options.domain.concat(this.search_results['domain']); var render_res = session.web.qweb.render('mail.wall_thread_container', {}); $('
  • ').html(render_res).appendTo(this.$el.find('ul.oe_mail_wall_threads')); var thread = new mail.Thread(this, { - 'domain': this.options.domain, 'context': this.options.context, + 'domain': thread_domain, 'context': this.options.context, 'thread_level': this.options.thread_level, 'composer': true, // display options 'show_header_compose': true, 'show_reply': this.options.thread_level > 0, @@ -757,7 +755,7 @@ openerp.mail = function(session) { } ); thread.appendTo(this.$el.find('li.oe_mail_wall_thread:last')); - this.thread_list.push(thread); + this.thread = thread; }, }); };