From 688f564ee2200dc896541079e26648497fbd9968 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Thu, 29 Jan 2015 18:52:18 +0200 Subject: [PATCH] [FIX] force update 'sent' field after calling _notify --- models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/models.py b/models.py index 6c80f9e..27e0425 100644 --- a/models.py +++ b/models.py @@ -9,3 +9,10 @@ class mail_message(models.Model): self.sent = len(self.notified_partner_ids) > 1 or len(self.notified_partner_ids)==1 and self.notified_partner_ids[0].id != self.author_id.id sent = fields.Boolean('Sent', compute=_get_sent, help='Was message sent to someone', store=True) + +class mail_notification(models.Model): + _inherit = 'mail.notification' + + def _notify(self, cr, uid, message_id, **kwargs): + super(mail_notification, self)._notify(cr, uid, message_id, **kwargs) + self.pool['mail.message'].browse(cr, uid, message_id)._get_sent()