From 42c5eea6771e85b35f4dcfb840abd95ddcabb319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 29 Jul 2015 13:33:56 +0200 Subject: [PATCH] [FIX] mail: chatter: do not crash when reading the chatter of unactive records. The chatter now uses a correct read_ids (no need to have a search set), with an active_test in the context allowing to read on unactive records. --- addons/mail/static/src/js/mail.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 688faf3c1e7..63f9e4f05a5 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -859,8 +859,12 @@ var MailThread = Attachment.extend ({ this.nb_followers = 0; this.follower_ids = []; - this.ds_res = new data.DataSetSearch(this, this.model, this.context, [['id', '=', this.res_id]]); - this.ds_res.read_slice(['id', 'message_follower_ids']).then(function (data) { + var ctx = this.context; + ctx['active_test'] = true; + this.ds_res = new data.DataSet(this, this.model, ctx); + this.ds_res.read_ids([this.res_id], ['id', 'message_follower_ids'], { + 'context': ctx, + }).then(function (data) { self.follower_ids = data[0].message_follower_ids; self.nb_followers = data[0].message_follower_ids.length; self.followers_loaded.resolve();