Files
odoo_source/addons/mass_mailing_slides/models/slide_channel.py
T
Thibault DelavalléeandAurélien Warnon 110decad00 [REF] mass_mailing(_sms): force domain reset when changing model / type
In this commit we rewrite the compute on mailing domain to simply reset it
once the mailing domain is changed. Indeed trying to keep a previous domain
based on try / except has no meaning from functional point of view. If model
changes then domain should change as it is a business record, not just a
technical domain to try to apply.

LINKS

Task ID 2088577
PR #41877
Enterprise PR odoo/enterprise#7278

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Aurélien Warnon <awa@odoo.com>
2019-12-16 15:58:16 +00:00

24 lines
741 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, _
class Course(models.Model):
_inherit = "slide.channel"
def action_mass_mailing_attendees(self):
domain = repr([('slide_channel_ids', 'in', self.ids)])
mass_mailing_action = dict(
name=_('Mass Mail Course Members'),
type='ir.actions.act_window',
res_model='mailing.mailing',
view_mode='form',
target='current',
context=dict(
default_mailing_model_id=self.env.ref('base.model_res_partner').id,
default_mailing_domain=domain,
),
)
return mass_mailing_action