[FIX] mail: mark all as read, remove notification as sudo

As it's done few lines below,
in `set_message_done`.

The user could have a notication associated
to a message he has not, or no longer, the
write access, but he should still be able
to mark it as read.

opw-671188
This commit is contained in:
Denis Ledoux
2016-03-07 11:21:42 +01:00
parent 018b53bc15
commit a37bd77895
+1 -1
View File
@@ -175,7 +175,7 @@ class Message(models.Model):
if channel_ids:
msg_domain += [('channel_ids', 'in', channel_ids)]
unread_messages = self.search(expression.AND([msg_domain, domain]))
unread_messages.write({'needaction_partner_ids': [(3, partner_id)]})
unread_messages.sudo().write({'needaction_partner_ids': [(3, partner_id)]})
ids = unread_messages.mapped('id')
notification = {'type': 'mark_as_read', 'message_ids': ids, 'channel_ids': channel_ids}