summaryrefslogtreecommitdiff
path: root/addons/mail/models
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-10-09 11:36:59 +0200
committerChristophe Simonis <chs@odoo.com>2017-10-09 11:36:59 +0200
commitb5cbb2827ec8fccd070d3edcf31e8a1098e4ffed (patch)
tree328d94178949ad995051ba5b78e6ae786002b468 /addons/mail/models
parent1bbb7d62410d0fef9304c32b62a8aef032f97af8 (diff)
[FIX] mail: handle empty recordset when computing unread message count
Diffstat (limited to 'addons/mail/models')
-rw-r--r--addons/mail/models/mail_thread.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py
index 4f7e89ae26b..af32d394332 100644
--- a/addons/mail/models/mail_thread.py
+++ b/addons/mail/models/mail_thread.py
@@ -175,10 +175,10 @@ class MailThread(models.AbstractModel):
RIGHT JOIN mail_channel_partner cp
ON (cp.channel_id = rel.mail_channel_id AND cp.partner_id = %s AND
(cp.seen_message_id IS NULL OR cp.seen_message_id < msg.id))
- WHERE msg.model = %s AND msg.res_id in %s AND
+ WHERE msg.model = %s AND msg.res_id = ANY(%s) AND
(msg.author_id IS NULL OR msg.author_id != %s) AND
(msg.message_type != 'notification' OR msg.model != 'mail.channel')""",
- (partner_id, self._name, tuple(self.ids), partner_id,))
+ (partner_id, self._name, list(self.ids), partner_id,))
for result in self._cr.fetchall():
res[result[0]] += 1