Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Email Marketing

Entity: mailing.mailing

Compute Method: _compute_recipients_count

Inputs Method Outputs
"""Calculate the total number of recipients in the mailing.
        (Opted out contacts are not excluded from the count)"""
for mailing in self:
            if mailing.mailing_domain:
                mailing.recipients_count = self.env[mailing.mailing_model_real].search_count(mailing._get_recipients_domain())
            elif mailing.contact_list_ids:
                mailing.recipients_count = sum(contact_list.contact_count for contact_list in mailing.contact_list_ids)
            else:
                mailing.recipients_count = 0

Back to entity