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

Module: SMS Marketing

Entity: mailing.mailing

Compute Method: _compute_sms_has_iap_failure

Inputs Method Outputs
self.sms_has_insufficient_credit = self.sms_has_unregistered_account = False
traces = self.env['mailing.trace'].sudo()._read_group([
                    ('mass_mailing_id', 'in', self.ids),
                    ('trace_type', '=', 'sms'),
                    ('failure_type', 'in', ['sms_acc', 'sms_credit'])
        ], ['mass_mailing_id', 'failure_type'])
for mass_mailing, failure_type in traces:
            if failure_type == 'sms_credit':
                mass_mailing.sms_has_insufficient_credit = True
            elif failure_type == 'sms_acc':
                mass_mailing.sms_has_unregistered_account = True

Back to entity