Files
odoo_source/addons/test_mass_mailing/models/mass_mail_test.py
T
Thibault Delavallée dbd4aab6c3 [REF] mail: make blacklist a mixin built upon mail.thread and add message_bounce
* mail.blacklist.mixin now clearly make inheritance on mail.thread. Indeed
    we consider models using the blacklist mechanism as being used in mailing
    features, meaning they will anyway inherit form mail.thread. In standard
    Odoo it is the case for the 3 models using it (Lead/Opportunity, Contact
    and Mailing Contact);
  * define message_bounce directly in mail.blacklist.mixin. Bounce counter
    is indeed linked to the blacklist and mailing mechanism;
  * rename mail.blacklist.mixin to mail.thread.blacklist to ensure coherency
    with mail.thread and mail.thread.cc (another mixin build on mailL.thread);

Inherit declarations in various addons are updated accordingly.

Related to task ID 1911679
Linked to PR #29483
2019-05-13 15:18:40 +00:00

35 lines
1.0 KiB
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class MassMailTest(models.Model):
""" A very simple model only inheriting from mail.thread to test pure mass
mailing features and base performances. """
_description = 'Simple Mass Mailing Model'
_name = 'mass.mail.test'
_inherit = ['mail.thread', 'mail.address.mixin']
_primary_email = 'email_from'
name = fields.Char()
email_from = fields.Char()
class MassMailTestBlacklist(models.Model):
""" Model using blacklist mechanism for mass mailing. """
_description = 'Mass Mailing Model w Blacklist'
_name = 'mass.mail.test.bl'
_inherit = ['mail.thread.blacklist']
_primary_email = 'email_from' # blacklist field to check
name = fields.Char()
email_from = fields.Char()
user_id = fields.Many2one(
'res.users', 'Responsible',
tracking=True)
umbrella_id = fields.Many2one(
'mail.test', 'Meta Umbrella Record',
tracking=True)