[FIX] mass_mailing_event: keep default domain

Before this commit, when cliking on "mass mail attendees" on a event form
the default domain on the attendees for determining the mass mailing recipient
was lost in an onchange

After this commit, we retrieve the right domain

OPW 1869308
closes #26081
This commit is contained in:
Lucas Perais (lpe)
2018-08-02 09:35:29 +02:00
parent 22b31152ca
commit dda2f0f861
2 changed files with 13 additions and 0 deletions
@@ -2,3 +2,4 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import event
from . import mass_mailing
@@ -0,0 +1,12 @@
from odoo import models, api
class MassMailingCampaign(models.Model):
_inherit = "mail.mass_mailing"
@api.onchange('mailing_model_id', 'contact_list_ids')
def _onchange_model_and_list(self):
result = super(MassMailingCampaign, self)._onchange_model_and_list()
if self.mailing_model_name == 'event.registration' and self.mailing_domain == '[]':
self.mailing_domain = self.env.context.get('default_mailing_domain', '[]')
return result