[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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user