[FIX] mail: handle empty recordset when computing unread message count
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user