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.medium']._fetch_or_create_utm_medium('email').id