Browse Source

[FIX] force update 'sent' field after calling _notify

pull/2/head
Ivan Yelizariev 10 years ago
parent
commit
688f564ee2
  1. 7
      models.py

7
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 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) 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()
Loading…
Cancel
Save