You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
597 B

  1. # -*- coding: utf-8 -*-
  2. # © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from openerp import models, api
  5. class MailTrackingEvent(models.Model):
  6. _inherit = "mail.tracking.event"
  7. @api.model
  8. def process_open(self, tracking_email, metadata):
  9. res = super(MailTrackingEvent, self).process_open(
  10. tracking_email, metadata)
  11. mail_mail_stats = self.sudo().env['mail.mail.statistics']
  12. mail_mail_stats.set_opened(mail_mail_ids=[tracking_email.mail_id_int])
  13. return res