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

View 20.0
Inputs Method Outputs
  • mailing_domain
  • mailing_model_real
  • contact_list_ids
+ """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
  • recipients_count

Back to entity