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

Module: SMS gateway

Entity: mail.notification

Compute Method: _compute_sms_id

Inputs Method Outputs
self.sms_id = False
sms_notifications = self.filtered(lambda n: n.notification_type == 'sms' and bool(n.sms_id_int))
if not sms_notifications:
            return
existing_sms_ids = self.env['sms.sms'].sudo().search([
            ('id', 'in', sms_notifications.mapped('sms_id_int')), ('to_delete', '!=', True)
        ]).ids
for sms_notification in sms_notifications.filtered(lambda n: n.sms_id_int in set(existing_sms_ids)):
            sms_notification.sms_id = sms_notification.sms_id_int

Back to entity