From a85efef0b6d2f503422ab6746ed28bac3ed25e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 3 Apr 2012 15:38:59 +0200 Subject: [PATCH] [FIX] thread widget: fixed a bug with array union instead of concatenation, leading to a wrong domain given to fetch method. bzr revid: tde@openerp.com-20120403133859-scc2ctgut3ygsc9y --- addons/mail/mail_thread.py | 5 ++--- addons/mail/static/src/js/mail.js | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index dbbf3dad522..6d26e945c1d 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -383,7 +383,7 @@ class mail_thread(osv.osv): msg_ids = self.message_load_ids(cr, uid, ids, limit, offset, domain, ascent, root_ids, context=context) return self.pool.get('mail.message').read(cr, uid, msg_ids, context=context) - def get_pushed_messages(self, cr, uid, ids, limit=100, offset=0, notif_search_domain=[], msg_search_domain=[], ascent=False, root_ids=[], context=None): + def get_pushed_messages(self, cr, uid, ids, limit=100, offset=0, msg_search_domain=[], ascent=False, root_ids=[], context=None): """ OpenChatter: wall: get messages to display (=pushed notifications) :param domain: domain to add to the search; especially child_of is interesting when dealing with threaded display @@ -400,8 +400,7 @@ class mail_thread(osv.osv): if isinstance(arg, (tuple, list)): arg[0] = 'message_id.' + arg[0] # compose final domain - domain = [('user_id', '=', uid)] + notif_search_domain + msg_search_domain - #print domain + domain = [('user_id', '=', uid)] + msg_search_domain # get notifications notification_ids = notification_obj.search(cr, uid, domain, limit=limit, offset=offset, context=context) notifications = notification_obj.browse(cr, uid, notification_ids, context=context) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index b10ccbec203..610a0c8dd04 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -647,12 +647,12 @@ openerp.mail = function(session) { */ fetch_comments: function (limit, offset, additional_domain, additional_context) { var self = this; - if (additional_domain) var fetch_domain = _.union(this.params.search['domain'], additional_domain); + if (additional_domain) var fetch_domain = this.params.search['domain'].concat(additional_domain); else var fetch_domain = this.params.search['domain']; if (additional_context) var fetch_context = _.extend(this.params.search['context'], additional_context); else var fetch_context = this.params.search['context']; var load_res = this.ds_thread.call('get_pushed_messages', - [[this.session.uid], (limit || 0), (offset || 0), [], fetch_domain, true, [], fetch_context]).then(function (records) { + [[this.session.uid], (limit || 0), (offset || 0), fetch_domain, true, [], fetch_context]).then(function (records) { self.do_update_show_more(records.length >= self.params.limit); self.display_comments(records); });