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.

21 lines
772 B

  1. # Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
  2. # Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo import models, api, fields
  5. class MailMassMailingContact(models.Model):
  6. _name = 'mail.mass_mailing.contact'
  7. _inherit = ['mail.mass_mailing.contact', 'mail.bounced.mixin']
  8. email_score = fields.Float(
  9. string="Email score", readonly=True, store=False,
  10. compute='_compute_email_score')
  11. @api.multi
  12. @api.depends('email')
  13. def _compute_email_score(self):
  14. for contact in self.filtered('email'):
  15. contact.email_score = self.env['mail.tracking.email'].\
  16. email_score_from_email(contact.email)