OdooMindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
for mailing in self:
if mailing.mailing_type == 'mail' and not mailing.medium_id:
mailing.medium_id = self.env['utm.mixin']._utm_ref('utm.utm_medium_email').id