Skip to content

Commit 7830a86

Browse files
committed
[ADD] mail_thread_cc_bcc
1 parent 918c5f6 commit 7830a86

File tree

12 files changed

+589
-0
lines changed

12 files changed

+589
-0
lines changed

mail_thread_cc_bcc/README.rst

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
==================
2+
Mail Thread Cc Bcc
3+
==================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:b9a5b5983013b6c39a20db4f46fc295b1dc2d9dfdc17805209fa37e7edc58d85
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github
20+
:target: https://github.com/OCA/social/tree/16.0/mail_thread_cc_bcc
21+
:alt: OCA/social
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_thread_cc_bcc
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=16.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module extends the default behavior of mail.thread to include <b>CC</b> and <b>BCC</b> recipients in the routing process for incoming email messages.
32+
With it, messages arriving in Odoo via the email gateway now also consider the addresses added as copies and blind carbon copies, ensuring that all relevant recipients are processed appropriately.
33+
Main features:
34+
Automatic inclusion of CC and BCC addresses in message_dict['recipients'].
35+
Fully compatible with Odoo's native message routing flow.
36+
Lightweight implementation with no impact on existing functionality.
37+
38+
**Table of contents**
39+
40+
.. contents::
41+
:local:
42+
43+
Usage
44+
=====
45+
46+
After installing the mail_thread_cc_bcc module, no additional configuration is required.
47+
Whenever an email is received by Odoo—whether via template alias, forwarding, or SMTP integration—the system automatically includes recipients from the CC and BCC (Bcc) fields when processing the mail.thread.
48+
This ensures that:
49+
Messages sent with a copy or blind carbon copy are also routed correctly.
50+
All relevant participants are associated with the corresponding thread or record.
51+
This behavior is completely transparent and integrated into Odoo's standard email flow.
52+
53+
Bug Tracker
54+
===========
55+
56+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_.
57+
In case of trouble, please check there if your issue has already been reported.
58+
If you spotted it first, help us to smash it by providing a detailed and welcomed
59+
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_thread_cc_bcc%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
60+
61+
Do not contact contributors directly about support or help with technical issues.
62+
63+
Credits
64+
=======
65+
66+
Authors
67+
~~~~~~~
68+
69+
* KMEE
70+
71+
Contributors
72+
~~~~~~~~~~~~
73+
74+
* Tiago Amaral <[email protected]>
75+
76+
Maintainers
77+
~~~~~~~~~~~
78+
79+
This module is maintained by the OCA.
80+
81+
.. image:: https://odoo-community.org/logo.png
82+
:alt: Odoo Community Association
83+
:target: https://odoo-community.org
84+
85+
OCA, or the Odoo Community Association, is a nonprofit organization whose
86+
mission is to support the collaborative development of Odoo features and
87+
promote its widespread use.
88+
89+
This module is part of the `OCA/social <https://github.com/OCA/social/tree/16.0/mail_thread_cc_bcc>`_ project on GitHub.
90+
91+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

mail_thread_cc_bcc/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models

mail_thread_cc_bcc/__manifest__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2025 KMEE
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Mail Thread Cc Bcc",
6+
"summary": """kmee""",
7+
"version": "16.0.1.0.0",
8+
"license": "AGPL-3",
9+
"author": "KMEE, Odoo Community Association (OCA)",
10+
"website": "https://github.com/OCA/social",
11+
"depends": ["mail"],
12+
"data": [],
13+
"demo": [],
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import mail_thread
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2025 KMEE
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import api, models
5+
6+
7+
class MailThread(models.AbstractModel):
8+
9+
_inherit = "mail.thread"
10+
11+
@api.model
12+
def message_route(
13+
self, message, message_dict, model=None, thread_id=None, custom_values=None
14+
):
15+
email_to = message_dict.get("to", "")
16+
email_cc = message_dict.get("cc", "")
17+
email_bcc = message_dict.get("bcc", "")
18+
all_recipients = ",".join(filter(None, [email_to, email_cc, email_bcc]))
19+
if all_recipients:
20+
message_dict["recipients"] = all_recipients
21+
message_dict["to"] = all_recipients
22+
return super().message_route(
23+
message, message_dict, model, thread_id, custom_values
24+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Tiago Amaral <[email protected]>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
This module extends the default behavior of mail.thread to include <b>CC</b> and <b>BCC</b> recipients in the routing process for incoming email messages.
2+
With it, messages arriving in Odoo via the email gateway now also consider the addresses added as copies and blind carbon copies, ensuring that all relevant recipients are processed appropriately.
3+
Main features:
4+
Automatic inclusion of CC and BCC addresses in message_dict['recipients'].
5+
Fully compatible with Odoo's native message routing flow.
6+
Lightweight implementation with no impact on existing functionality.

mail_thread_cc_bcc/readme/ROADMAP.rst

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
After installing the mail_thread_cc_bcc module, no additional configuration is required.
2+
Whenever an email is received by Odoo—whether via template alias, forwarding, or SMTP integration—the system automatically includes recipients from the CC and BCC (Bcc) fields when processing the mail.thread.
3+
This ensures that:
4+
Messages sent with a copy or blind carbon copy are also routed correctly.
5+
All relevant participants are associated with the corresponding thread or record.
6+
This behavior is completely transparent and integrated into Odoo's standard email flow.

0 commit comments

Comments
 (0)