Skip to content
Snippets Groups Projects
Commit 500b845b authored by Thibault Delavallée's avatar Thibault Delavallée
Browse files

[IMP] mass_mailing_{event/event_track/sale}: add default mailing domains


When performing an email or SMS mailing on functional models a default domain
is a good start to avoid sending notifications to dead records, aka

  * canceled registrations;
  * canceled tracks;
  * canceled sale orders;

Task ID-2431217
COM PR odoo#67322
ENT PR odoo/enterprise#16876
UPG PR odoo/upgrade#2236

closes odoo/odoo#67322

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent ed508ee1
No related branches found
No related tags found
No related merge requests found
......@@ -7,3 +7,6 @@ from odoo import models
class EventRegistration(models.Model):
_inherit = 'event.registration'
_mailing_enabled = True
def _mailing_get_default_domain(self, mailing):
return [('state', '!=', 'cancel')]
......@@ -7,3 +7,6 @@ from odoo import models
class EventTrack(models.Model):
_inherit = 'event.track'
_mailing_enabled = True
def _mailing_get_default_domain(self, mailing):
return [('stage_id.is_cancel', '=', False)]
......@@ -7,3 +7,7 @@ from odoo import models
class SaleOrder(models.Model):
_inherit = 'sale.order'
_mailing_enabled = True
def _mailing_get_default_domain(self, mailing):
""" Exclude by default canceled orders when performing a mass mailing. """
return [('state', '!=', 'cancel')]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment