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.

23 lines
711 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2015 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis
  3. # Copyright 2016 Tecnativa - Vicent Cubells
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  5. from openerp import models
  6. class MailMassMailingContact(models.Model):
  7. _inherit = "mail.mass_mailing.contact"
  8. _sql_constraints = [
  9. ("unique_mail_per_list", "UNIQUE(list_id, email)",
  10. "Cannot have the same email more than once in the same list.")
  11. ]
  12. class MailMassMailingList(models.Model):
  13. _inherit = "mail.mass_mailing.list"
  14. _sql_constraints = [
  15. ("unique_name", "UNIQUE(name)",
  16. "Cannot have more than one lists with the same name.")
  17. ]