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.
20 lines
729 B
20 lines
729 B
# -*- coding: utf-8 -*-
|
|
# Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
|
|
from openerp import models, api
|
|
from .mail_mass_mailing import event_filtered_ids
|
|
|
|
|
|
class MailMassMailingContact(models.Model):
|
|
_inherit = 'mail.mass_mailing.contact'
|
|
|
|
@api.model
|
|
def search_count(self, domain):
|
|
res = super(MailMassMailingContact, self).search_count(domain)
|
|
mass_mailing_id = self.env.context.get('exclude_mass_mailing', False)
|
|
if mass_mailing_id:
|
|
res_ids = event_filtered_ids(
|
|
self, mass_mailing_id, domain, field='email')
|
|
return len(res_ids) if res_ids else 0
|
|
return res
|