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.

19 lines
684 B

  1. # Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import api, models
  4. from .mail_mass_mailing import event_filtered_ids
  5. class EventRegistration(models.Model):
  6. _inherit = 'event.registration'
  7. @api.model
  8. def search_count(self, domain):
  9. res = super(EventRegistration, self).search_count(domain)
  10. mass_mailing_id = self.env.context.get('exclude_mass_mailing', False)
  11. if mass_mailing_id:
  12. res_ids = event_filtered_ids(
  13. self, mass_mailing_id, domain, field='email')
  14. res = len(res_ids) if res_ids else 0
  15. return res