Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions mail_composer_cc_bcc_mail_tracking/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
================================
Email CC and BCC - Mail Tracking
================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9bb139a8dbb259124cce7e434cd4dd8bb1248d51cc15b6d5f31af3a81e8684bd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github
:target: https://github.com/OCA/mail/tree/18.0/mail_composer_cc_bcc_mail_tracking
:alt: OCA/mail
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_composer_cc_bcc_mail_tracking
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Glue module between

- `mail_composer_cc_bcc <../mail_composer_cc_bcc>`__
- `mail_tracking <../mail_tracking>`__.

It shows, in the chatter, which recipients were in To, Cc and Bcc for
each sent message, reusing mail_tracking's clickable recipient widget.

Features
--------

- The "To" line rendered by mail_tracking becomes collapsible:

- shows all recipients
- expanding it splits them into To / Cc / Bcc

- Global setting to choose which one is the default (collapsed or
expanded)
- Global setting to choose whether or not we can collapse from one mode
to the other

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/mail/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/mail/issues/new?body=module:%20mail_composer_cc_bcc_mail_tracking%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Camptocamp

Contributors
------------

- `Camptocamp <https://www.camptocamp.com>`__:

- David Gallay <david.gallay@camptocamp.com>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/18.0/mail_composer_cc_bcc_mail_tracking>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions mail_composer_cc_bcc_mail_tracking/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
29 changes: 29 additions & 0 deletions mail_composer_cc_bcc_mail_tracking/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2026 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Email CC and BCC - Mail Tracking",
"summary": "Show Cc/Bcc recipients below the To line in the chatter.",
"version": "18.0.1.0.0",
"development_status": "Alpha",
"category": "Social",
"website": "https://github.com/OCA/mail",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"auto_install": True,
"depends": [
"mail_composer_cc_bcc",
"mail_tracking",
],
"data": [
"views/res_config_settings_views.xml",
],
"assets": {
"web.assets_backend": [
"mail_composer_cc_bcc_mail_tracking/static/src/message_model.esm.js",
"mail_composer_cc_bcc_mail_tracking/static/src/message.esm.js",
"mail_composer_cc_bcc_mail_tracking/static/src/message.xml",
],
},
}
3 changes: 3 additions & 0 deletions mail_composer_cc_bcc_mail_tracking/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import res_company
from . import res_config_settings
from . import mail_message
65 changes: 65 additions & 0 deletions mail_composer_cc_bcc_mail_tracking/models/mail_message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright 2026 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models

from odoo.addons.mail.tools.discuss import Store


class MailMessage(models.Model):
_inherit = "mail.message"

def tracking_status(self):
res = super().tracking_status()

# Flag each recipient as Cc/Bcc using the
# partner-based recipient_cc_ids / recipient_bcc_ids
# (authoritative, set by the mail composer).
# Recipients themselves are already listed
# by super() through notified_partner_ids.
to_ids = set(self.partner_ids.ids)
cc_ids = set(self.recipient_cc_ids.ids)
bcc_ids = set(self.recipient_bcc_ids.ids)
for tracking in res:
pid = tracking.get("partner_id")
is_cc = pid in cc_ids
is_bcc = pid in bcc_ids
# A recipient is "To" when explicitly in partner_ids, or when it is
# neither Cc nor Bcc (followers / notified partners). A partner may
# belong to several lists at once.
tracking.update(
{
"isTo": pid in to_ids or not (is_cc or is_bcc),
"isCc": is_cc,
"isBcc": is_bcc,
}
)
return res

def _recipients_display_company(self):
"""Company whose settings drive the chatter recipients display."""
self.ensure_one()
return self.record_company_id or self.env.company

def _recipients_default_expanded(self):
"""Whether the To/Cc/Bcc split is shown by default (else single 'To')."""
self.ensure_one()
company = self._recipients_display_company()
return company.chatter_recipients_default_display == "expanded"

def _recipients_allow_toggle(self):
"""Whether the user may switch between the collapsed and expanded views."""
self.ensure_one()
return self._recipients_display_company().chatter_recipients_allow_toggle

def _extras_to_store(self, store: Store, format_reply):
res = super()._extras_to_store(store, format_reply=format_reply)
for message in self:
store.add(
message,
{
"recipientsDefaultExpanded": message._recipients_default_expanded(),
"recipientsAllowToggle": message._recipients_allow_toggle(),
},
)
return res
26 changes: 26 additions & 0 deletions mail_composer_cc_bcc_mail_tracking/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2026 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResCompany(models.Model):
_inherit = "res.company"

chatter_recipients_default_display = fields.Selection(
selection=[
("collapsed", "Single 'To' line"),
("expanded", "To / Cc / Bcc split"),
],
string="Default recipient display",
default="collapsed",
required=True,
help="How chatter recipients are shown by default: a single collapsed "
"'To' line, or the full To/Cc/Bcc split.",
)
chatter_recipients_allow_toggle = fields.Boolean(
string="Allow toggling chatter recipients",
default=True,
help="Let users switch between the single 'To' line and the full "
"To/Cc/Bcc display. When disabled, only the default display is shown.",
)
18 changes: 18 additions & 0 deletions mail_composer_cc_bcc_mail_tracking/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2026 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

chatter_recipients_default_display = fields.Selection(
related="company_id.chatter_recipients_default_display",
readonly=False,
required=True,
)
chatter_recipients_allow_toggle = fields.Boolean(
related="company_id.chatter_recipients_allow_toggle",
readonly=False,
)
3 changes: 3 additions & 0 deletions mail_composer_cc_bcc_mail_tracking/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions mail_composer_cc_bcc_mail_tracking/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Camptocamp](https://www.camptocamp.com):
- David Gallay \<<david.gallay@camptocamp.com>\>
14 changes: 14 additions & 0 deletions mail_composer_cc_bcc_mail_tracking/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Glue module between
- [mail_composer_cc_bcc](../mail_composer_cc_bcc)
- [mail_tracking](../mail_tracking).

It shows, in the chatter, which recipients were in To, Cc and Bcc for each
sent message, reusing mail_tracking's clickable recipient widget.

## Features

- The "To" line rendered by mail_tracking becomes collapsible:
- shows all recipients
- expanding it splits them into To / Cc / Bcc
- Global setting to choose which one is the default (collapsed or expanded)
- Global setting to choose whether or not we can collapse from one mode to the other
Loading
Loading