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: Thibault Delavallee (tde) <tde@openerp.com>
13 lines
320 B
Python
13 lines
320 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
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)]
|