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

Module: Mail Gateway

Entity: mail.message

Compute Method: _compute_gateway_channel_ids

Inputs Method Outputs
for record in self:
            if self.env.user.has_group("mail_gateway.gateway_user"):
                partners = record.notification_ids.res_partner_id
                channels = partners.gateway_channel_ids.filtered(
                    lambda r, messages=record.gateway_message_ids: (
                        r.gateway_token,
                        r.gateway_id.id,
                    )
                    not in [
                        (
                            notification.gateway_channel_id.gateway_channel_token,
                            notification.gateway_channel_id.gateway_id.id,
                        )
                        for notification in messages.gateway_notification_ids
                    ]
                )
            else:
                channels = self.env["res.partner.gateway.channel"]
            record.gateway_channel_ids = channels
            record.gateway_channel_data = {
                "channels": channels.ids,
                "partners": channels.partner_id.ids,
            }

Back to entity