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>
23 lines
750 B
Python
23 lines
750 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models
|
|
|
|
|
|
class Event(models.Model):
|
|
_inherit = "event.event"
|
|
|
|
def action_mass_mailing_track_speakers(self):
|
|
mass_mailing_action = dict(
|
|
name='Mass Mail Attendees',
|
|
type='ir.actions.act_window',
|
|
res_model='mailing.mailing',
|
|
view_mode='form',
|
|
target='current',
|
|
context=dict(
|
|
default_mailing_model_id=self.env.ref('website_event_track.model_event_track').id,
|
|
default_mailing_domain=repr([('event_id', 'in', self.ids), ('stage_id.is_cancel', '!=', True)]),
|
|
),
|
|
)
|
|
return mass_mailing_action
|