Repository
OCA/mail · module folder · Try on Runboat
Module version
Category
Social Network
Folder size
2.57 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/mail
Last tracking update
2026-08-12 11:28:17
Authors
Odoo Community Association (OCA), Tecnativa
Maintainers
Odoo Community Association (OCA), Tecnativa
Committers
Carlos Lopez, Yann Papouin, Quoc - Pham Ngoc, Pilar Vargas, Weblate, OCA-git-bot, oca-ci
Odoo dependencies
odoo/odoo:
- web
- bus
Python dependencies
None
System dependencies
None
Required by
mail_tracking_mailgun, mail_tracking_mass_mailing
Description
This module shows email notification tracking status for any messages in
mail thread (chatter). Each notified partner will have an intuitive icon
just right to his name.

Code Analysis

Views touched (10)
XML IDNameModelTypeStatus
res_config_settings_view_form res.config.settings.view.form.inherit.mail.tracking res.config.settings form Inherits mail.res_config_settings_view_form
view_mail_tracking_email_form mail.tracking.email.form mail.tracking.email form New
view_mail_tracking_email_search mail.tracking.email.search mail.tracking.email search New
view_mail_tracking_email_tree mail.tracking.email.list mail.tracking.email list New
view_mail_tracking_event_form mail.tracking.event.form mail.tracking.event form New
view_mail_tracking_event_search mail.tracking.event.search mail.tracking.event search New
view_mail_tracking_event_tree mail.tracking.event.list mail.tracking.event list New
view_message_form mail.message form Inherits mail.mail_message_view_form
view_partner_form Partner Form with tracking emails res.partner form Inherits base.view_partner_form
view_res_partner_filter Filter bounced partners res.partner Inherits base.view_res_partner_filter
HTTP endpoints (2)
Route(s)HandlerAuthTypeMethodsFlags
/mail/tracking/open/<string:db>/<int:tracking_email_id>/blank.gif, /mail/tracking/open/<string:db>/<int:tracking_email_id>/<string:token>/blank.gif MailTrackingController.mail_tracking_open none http GET sudo
/mail/failed/messages MailTrackingMailBoxController.discuss_failed_messages user jsonrpc POST
Models touched (13)

New fields (0)

No new fields.

Public methods (1)
  • send_email(self, message, mail_server_id=None, smtp_server=None, smtp_port=None, smtp_user=None, smtp_password=None, smtp_encryption=None, smtp_ssl_certificate=None, smtp_ssl_private_key=None, smtp_debug=False, smtp_session=None)
    @api.model

New fields (0)

No new fields.

Public methods (4)
  • create(self, vals_list)
    @api.model_create_multi
  • get_aliases(self)
    @api.model@tools.ormcache()
    We want to discard these addresses for trackings
  • unlink(self)
  • write(self, vals)

New fields (0)

No new fields.

Public methods (3)
  • create(self, vals_list)
    @api.model_create_multi
    We've got `mail.alias.get_aliases` method which is cached os we need to refresh the cache when we add a new alias domain
  • unlink(self)
    We've got `mail.alias.get_aliases` method which is cached os we need to refresh the cache when we remove an alias domain
  • write(self, vals)
    We've got `mail.alias.get_aliases` method which is cached os we need to refresh the cache when we add a new alias domain

New fields (1)
  • email_bounced Boolean
    index=True
Public methods (2)
  • email_bounced_set(self, tracking_emails, reason, event=None)
    Inherit this method to make any other actions to the model that inherit the mixin
  • write(self, vals)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (5)
  • email_cc Char
    help='Additional recipients that receive a "Carbon Copy" of the e-mail' args: 'Cc'
  • email_to Char
    help='Raw TO recipients' args: 'To'
  • is_failed_message Boolean
    compute='_compute_is_failed_message' search='_search_is_failed_message'
  • mail_tracking_ids One2many → mail.tracking.email
    bypass_search_access=True comodel_name='mail.tracking.email' inverse_name='mail_message_id' string='Mail Trackings'
  • mail_tracking_needs_action Boolean
    default=False help='The message tracking will be considered to filter tracking issues'
Public methods (6)
  • get_failed_count(self)
    @api.model
    Gets the number of failed messages used on discuss mailbox item
  • get_failed_messages(self)
    Returns the list of failed messages to be used by the failed_messages widget
  • get_failed_messsage_info(self, ids, model)
    @api.model
  • get_failed_states(self)
    @api.model
    The 'failed' states of the message
  • set_need_action_done(self)
    This will mark the messages to be ignored in the tracking issues filter
  • tracking_status(self)
    Generates a complete status tracking of the messages by partner

New fields (1)
  • failed_message_ids One2many → mail.message
    domain=<expr> string='Failed Messages' args: 'mail.message', 'res_id'
Public methods (1)
  • get_view(self, view_id=None, view_type='form', **options)
    @api.model
    Add filters for failed messages. These filters will show up on any search views of any model inheriting from ``mail.thread``.

New fields (20)
  • bounce_description Char
    readonly=True
  • bounce_type Char
    readonly=True
  • date Date
    compute='_compute_date' readonly=True store=True
  • display_name Char
    compute='_compute_tracking_display_name' readonly=True store=True
  • error_description Char
    readonly=True
  • error_smtp_server Char
    readonly=True string='Error SMTP server'
  • error_type Char
    readonly=True
  • mail_id Many2one → mail.mail
    comodel_name='mail.mail' readonly=True string='Email'
  • mail_message_id Many2one → mail.message
    comodel_name='mail.message' index=True readonly=True
  • message_id Char
    compute='_compute_message_id'
  • name Char
    index=True readonly=True string='Subject'
  • partner_id Many2one → res.partner
    comodel_name='res.partner' readonly=True
  • recipient Char
    readonly=True string='Recipient email'
  • recipient_address Char
    compute='_compute_recipient_address' index=True readonly=True store=True string='Recipient email address'
  • sender Char
    readonly=True string='Sender email'
  • state Selection
    default=False help=" * The 'Error' status indicates that there was an error when trying to sent the email, for example, 'No valid recipient'\n * The 'Sent' status indicates that message was succesfully sent via outgoing email server (SMTP).\n * The 'Delivered' status indicates that message was succesfully delivered to recipient Mail Exchange (MX) server.\n * The 'Opened' status indicates that message was opened or clicked by recipient.\n * The 'Rejected' status indicates that recipient email address is blacklisted by outgoing email server (SMTP). It is recomended to delete this email address.\n * The 'Spam' status indicates that outgoing email server (SMTP) consider this message as spam.\n * The 'Unsubscribed' status indicates that recipient has requested to be unsubscribed from this message.\n * The 'Bounced' status indicates that message was bounced by recipient Mail Exchange (MX) server.\n * The 'Soft bounced' status indicates that message was soft bounced by recipient Mail Exchange (MX) server.\n" index=True readonly=True args: [('error', 'Error'), ('deferred', 'Deferred'), ('sent', 'Sent'), ('delivered', 'Delivered'), ('opened', 'Opened'), ('rejected', 'Rejected'), ('spam', 'Spam'), ('unsub', 'Unsubscribed'), ('bounced', 'Bounced'), ('soft-bounced', 'Soft bounced')]
  • time Datetime
    index=True readonly=True
  • timestamp Float
    digits='MailTracking Timestamp' readonly=True string='UTC timestamp'
  • token Char
    default=<expr> groups='base.group_system' readonly=True string='Security Token'
  • tracking_event_ids One2many → mail.tracking.event
    comodel_name='mail.tracking.event' inverse_name='tracking_email_id' readonly=True string='Tracking events'
Public methods (9)
  • create(self, vals_list)
    @api.model_create_multi
  • email_is_bounced(self, email)
    @api.model
  • email_score(self)
    Default email score algorimth. Ready to be inherited It can receive a recordset or mapped states dictionary via context. Must return a value beetwen 0.0 and 100.0 - Bad reputation: Value between 0 and 50.0 - Unknown reputation: Value 50.0 - Good reputation: Value between 50.0 and 100.0
  • email_score_from_email(self, email)
    @api.model
  • event_create(self, event_type, metadata)
  • read(self, fields=None, load='_classic_read')
    Override to explicitly call check_access, that is not called by the ORM. It instead directly fetches ir.rules and apply them.
  • smtp_error(self, mail_server, smtp_server, exception)
  • tracking_img_add(self, email)
  • write(self, vals)

New fields (19)
  • date Date
    compute='_compute_date' readonly=True store=True
  • error_description Char
    readonly=True
  • error_details Text
    readonly=True
  • error_type Char
    readonly=True
  • event_type Selection
    readonly=True selection=[('sent', 'Sent'), ('delivered', 'Delivered'), ('deferral', 'Deferral'), ('hard_bounce', 'Hard bounce'), ('soft_bounce', 'Soft bounce'), ('open', 'Open'), ('click', 'Clicked'), ('spam', 'Spam'), ('unsub', 'Unsubscribed'), ('reject', 'Rejected')]
  • ip Char
    readonly=True string='User IP'
  • mobile Boolean
    readonly=True string='Is mobile?'
  • os_family Char
    readonly=True string='Operating system family'
  • recipient Char
    readonly=True
  • recipient_address Char
    compute='_compute_recipient_address' index=True readonly=True store=True string='Recipient email address'
  • smtp_server Char
    readonly=True string='SMTP server'
  • time Datetime
    readonly=True
  • timestamp Float
    digits='MailTracking Timestamp' readonly=True string='UTC timestamp'
  • tracking_email_id Many2one → mail.tracking.email
    comodel_name='mail.tracking.email' index=True ondelete='cascade' readonly=True required=True string='Message'
  • ua_family Char
    readonly=True string='User agent family'
  • ua_type Char
    readonly=True string='User agent type'
  • url Char
    readonly=True string='Clicked URL'
  • user_agent Char
    readonly=True
  • user_country_id Many2one → res.country
    comodel_name='res.country' readonly=True string='User country'
Public methods (10)
  • process_click(self, tracking_email, metadata)
    @api.model
  • process_deferral(self, tracking_email, metadata)
    @api.model
  • process_delivered(self, tracking_email, metadata)
    @api.model
  • process_hard_bounce(self, tracking_email, metadata)
    @api.model
  • process_open(self, tracking_email, metadata)
    @api.model
  • process_reject(self, tracking_email, metadata)
    @api.model
  • process_sent(self, tracking_email, metadata)
    @api.model
  • process_soft_bounce(self, tracking_email, metadata)
    @api.model
  • process_spam(self, tracking_email, metadata)
    @api.model
  • process_unsub(self, tracking_email, metadata)
    @api.model

New fields (1)
  • mail_tracking_show_aliases Boolean
    default=False string='Show Aliases in Mail Tracking'
Public methods (0)

No public methods.

New fields (2)
  • mail_tracking_email_max_age_days Integer
    config_parameter='mail_tracking.mail_tracking_email_max_age_days' help='If set as positive integer enables the deletion of old mail tracking records to reduce the database size.' args: 'Max age in days of mail tracking email records'
  • mail_tracking_show_aliases Boolean
    readonly=False related='company_id.mail_tracking_show_aliases'
Public methods (0)

No public methods.

New fields (2)
  • email_score Float
    compute='_compute_email_score_and_count' readonly=True
  • tracking_emails_count Integer
    compute='_compute_email_score_and_count' readonly=True
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…