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
14 changes: 4 additions & 10 deletions mail_composer_cc_bcc/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

================
Email CC and BCC
================
Expand All @@ -11,13 +7,13 @@ Email CC and BCC
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:baa3864e6fc3754462520ec7eb76d0d09dbffbedbb627a99fe17c092ee3cf57f
!! source digest: sha256:5e7056e8253bca7efc5ac9245144740241c859cc47837e9c443639874eb86aa7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-AGPL--3-blue.png
.. |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
Expand Down Expand Up @@ -119,13 +115,11 @@ Contributors
- Son Ho <sonhd@trobz.com>
- Tri Doan <tridm@trobz.com>

- Alberto Nieto alberto.nieto@braintec.com (https://braintec.com)

Other credits
-------------

The creation and migration of this module from 16.0 to 17.0, and then
17.0 to 18.0 were financially supported by Camptocamp.
The creation and migration from 16.0 to 17.0 of this module were
financially supported by Camptocamp.

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion mail_composer_cc_bcc/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Email CC and BCC",
"summary": "This module enables sending mail to CC and BCC partners in mail composer form.", # noqa: E501
"version": "18.0.1.0.2",
"version": "18.0.1.0.1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this on purpose?

"development_status": "Alpha",
"category": "Social",
"website": "https://github.com/OCA/mail",
Expand Down
19 changes: 15 additions & 4 deletions mail_composer_cc_bcc/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2026-05-07 18:19+0000\n"
"Last-Translator: Ed-Spain <eduamoros@gmail.com>\n"
"PO-Revision-Date: 2023-11-08 13:02+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.15.2\n"
"X-Generator: Weblate 4.17\n"

#. module: mail_composer_cc_bcc
#: model:ir.model.fields,field_description:mail_composer_cc_bcc.field_mail_compose_message__partner_bcc_ids
#: model:ir.model.fields,field_description:mail_composer_cc_bcc.field_mail_mail__email_bcc
#: model:ir.model.fields,field_description:mail_composer_cc_bcc.field_mail_template__email_bcc
#: model:ir.model.fields,field_description:mail_composer_cc_bcc.field_mail_template_preview__email_bcc
msgid "Bcc"
msgstr "Bcc"

Expand All @@ -29,6 +30,11 @@ msgstr "Bcc"
msgid "Bcc (Partners)"
msgstr "Bcc (Socios)"

#. module: mail_composer_cc_bcc
#: model:ir.model.fields,help:mail_composer_cc_bcc.field_mail_template_preview__email_bcc
msgid "Blind Carbon copy recipients"
msgstr ""

#. module: mail_composer_cc_bcc
#: model:ir.model.fields,help:mail_composer_cc_bcc.field_mail_mail__email_bcc
msgid "Blind Cc message recipients"
Expand Down Expand Up @@ -72,6 +78,11 @@ msgstr "Bcc por defecto"
msgid "Default Cc"
msgstr "Cc por defecto"

#. module: mail_composer_cc_bcc
#: model:ir.model,name:mail_composer_cc_bcc.model_mail_template_preview
msgid "Email Template Preview"
msgstr ""

#. module: mail_composer_cc_bcc
#: model:ir.model,name:mail_composer_cc_bcc.model_mail_template
msgid "Email Templates"
Expand All @@ -90,7 +101,7 @@ msgstr "Asistente de redacción de correo electrónico"
#. module: mail_composer_cc_bcc
#: model:ir.model,name:mail_composer_cc_bcc.model_ir_mail_server
msgid "Mail Server"
msgstr "Servidor de correo"
msgstr ""

#. module: mail_composer_cc_bcc
#: model:ir.model,name:mail_composer_cc_bcc.model_mail_message
Expand Down
11 changes: 11 additions & 0 deletions mail_composer_cc_bcc/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail_composer_cc_bcc.field_mail_compose_message__partner_bcc_ids
#: model:ir.model.fields,field_description:mail_composer_cc_bcc.field_mail_mail__email_bcc
#: model:ir.model.fields,field_description:mail_composer_cc_bcc.field_mail_template__email_bcc
#: model:ir.model.fields,field_description:mail_composer_cc_bcc.field_mail_template_preview__email_bcc
msgid "Bcc"
msgstr "Ccn"

Expand All @@ -29,6 +30,11 @@ msgstr "Ccn"
msgid "Bcc (Partners)"
msgstr "Ccn (partner)"

#. module: mail_composer_cc_bcc
#: model:ir.model.fields,help:mail_composer_cc_bcc.field_mail_template_preview__email_bcc
msgid "Blind Carbon copy recipients"
msgstr "Nascondi destinatari copia carbone"

#. module: mail_composer_cc_bcc
#: model:ir.model.fields,help:mail_composer_cc_bcc.field_mail_mail__email_bcc
msgid "Blind Cc message recipients"
Expand Down Expand Up @@ -71,6 +77,11 @@ msgstr "Ccn predefinito"
msgid "Default Cc"
msgstr "Cc predefinito"

#. module: mail_composer_cc_bcc
#: model:ir.model,name:mail_composer_cc_bcc.model_mail_template_preview
msgid "Email Template Preview"
msgstr "Anteprima modello e-mail"

#. module: mail_composer_cc_bcc
#: model:ir.model,name:mail_composer_cc_bcc.model_mail_template
msgid "Email Templates"
Expand Down
2 changes: 1 addition & 1 deletion mail_composer_cc_bcc/i18n/mail_composer_cc_bcc.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down
23 changes: 13 additions & 10 deletions mail_composer_cc_bcc/models/mail_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@


def format_emails(partners):
return [tools.formataddr((p.name or "", p.email)) for p in partners if p.email]
emails = [
tools.formataddr((p.name or "", tools.email_normalize(p.email)))
for p in partners
if p.email
]
return ", ".join(emails)


def format_emails_raw(partners):
return [p.email for p in partners if p.email]


def format_emails_str(partners):
emails = format_emails(partners)
emails = [p.email for p in partners if p.email]
return ", ".join(emails)


Expand Down Expand Up @@ -45,7 +46,7 @@ def _prepare_outgoing_list(
partner_to = self.env["res.partner"].browse(partner_to_ids)
email_to = format_emails(partner_to)
email_to_raw = format_emails_raw(partner_to)
email_cc = format_emails_str(self.recipient_cc_ids)
email_cc = format_emails(self.recipient_cc_ids)
email_bcc = [r.email for r in self.recipient_bcc_ids if r.email]

# Collect recipients (RCPT TO) and update all emails
Expand All @@ -54,20 +55,22 @@ def _prepare_outgoing_list(
for m in res:
rcpt_to = None
if m["email_to"]:
rcpt_to = extract_rfc2822_addresses(m["email_to"][0])[0]
addresses = extract_rfc2822_addresses(m["email_to"][0])
rcpt_to = addresses[0] if addresses else None

# If the recipient is a Bcc, we had an explicit header X-Odoo-Bcc
# - It won't be shown by the email client, but can be useful for a recipient # noqa: E501
# to understand why he received a given email
# - Also note that in python3, the smtp.send_message method does not
# transmit the Bcc field of a Message object
if rcpt_to in email_bcc:
if rcpt_to and rcpt_to in email_bcc:
m["headers"].update({"X-Odoo-Bcc": m["email_to"][0]})

# in the absence of self.email_to, Odoo creates one special mail for CC
# see https://github.com/odoo/odoo/commit/46bad8f0
elif m["email_cc"]:
rcpt_to = extract_rfc2822_addresses(m["email_cc"][0])[0]
addresses = extract_rfc2822_addresses(m["email_cc"][0])
rcpt_to = addresses[0] if addresses else None

if rcpt_to:
recipients.add(rcpt_to)
Expand Down
10 changes: 6 additions & 4 deletions mail_composer_cc_bcc/models/mail_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from odoo import models

from .mail_mail import format_emails_str
from .mail_mail import format_emails


class MailThread(models.AbstractModel):
Expand Down Expand Up @@ -40,11 +40,11 @@ def _notify_by_email_get_base_mail_values(self, message, additional_values=None)

partners_cc = context.get("partner_cc_ids", None)
if partners_cc:
res["email_cc"] = format_emails_str(partners_cc)
res["email_cc"] = format_emails(partners_cc)

partners_bcc = context.get("partner_bcc_ids", None)
if partners_bcc:
res["email_bcc"] = format_emails_str(partners_bcc)
res["email_bcc"] = format_emails(partners_bcc)

return res

Expand Down Expand Up @@ -86,14 +86,16 @@ def _notify_get_recipients(self, message, msg_vals, **kwargs):
): # notif is False, has no user, is therefore customer
notif = "email"
msg_type = "customer"
partner = ResPartner.browse(data.get("id"))
user = partner.user_ids[:1] # Link partner → user
pdata = {
"id": data.get("id"),
"uid": user.id if user else False,
"active": data.get("active"),
"share": data.get("share"),
"notif": data.get("notif") and data.get("notif") or notif,
"type": msg_type,
"is_follower": data.get("is_follower"),
"uid": False,
}
rdata.append(pdata)
return rdata
Expand Down
4 changes: 1 addition & 3 deletions mail_composer_cc_bcc/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

> - Hai N. Le \<<hailn@trobz.com>\>
> - Son Ho \<<sonhd@trobz.com>\>
> - Tri Doan \<<tridm@trobz.com>\>

* Alberto Nieto <alberto.nieto@braintec.com> (https://braintec.com)
> - Tri Doan \<<tridm@trobz.com>\>
3 changes: 2 additions & 1 deletion mail_composer_cc_bcc/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
The creation and migration of this module from 16.0 to 17.0, and then 17.0 to 18.0 were financially supported by Camptocamp.
The creation and migration from 16.0 to 17.0 of this module were
financially supported by Camptocamp.
40 changes: 16 additions & 24 deletions mail_composer_cc_bcc/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>Email CC and BCC</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,21 +360,16 @@
</style>
</head>
<body>
<div class="document">
<div class="document" id="email-cc-and-bcc">
<h1 class="title">Email CC and BCC</h1>


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="email-cc-and-bcc">
<h1>Email CC and BCC</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:baa3864e6fc3754462520ec7eb76d0d09dbffbedbb627a99fe17c092ee3cf57f
!! source digest: sha256:5e7056e8253bca7efc5ac9245144740241c859cc47837e9c443639874eb86aa7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/mail/tree/18.0/mail_composer_cc_bcc"><img alt="OCA/mail" src="https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_composer_cc_bcc"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/mail&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/mail/tree/18.0/mail_composer_cc_bcc"><img alt="OCA/mail" src="https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_composer_cc_bcc"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/mail&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Odoo native does not support defining a Cc field in the Mail Composer by
default; instead, it only has a unique Recipients fields, which is
confusing for a lot of end users.</p>
Expand All @@ -383,7 +378,7 @@ <h1>Email CC and BCC</h1>
<p>From Odoo 17.0, this module sends one mail per recipient and keeps same
all headers (To, Cc, Bcc) in all emails</p>
<div class="section" id="features">
<h2>Features</h2>
<h1>Features</h1>
<ul class="simple">
<li>Add Cc and Bcc fields to company form to use them as default in mail
composer form.</li>
Expand All @@ -407,7 +402,7 @@ <h2>Features</h2>
</ul>
</div>
<div class="section" id="configuration">
<h3><a class="toc-backref" href="#toc-entry-1">Configuration</a></h3>
<h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
<p>In company form there are two fields to set default cc and bcc partners.</p>
<blockquote>
<img alt="res_company_form_default_cc_bcc" src="https://raw.githubusercontent.com/OCA/mail/18.0/mail_composer_cc_bcc/static/img/res_company_form_default_cc_bcc.png" /></blockquote>
Expand All @@ -416,7 +411,7 @@ <h3><a class="toc-backref" href="#toc-entry-1">Configuration</a></h3>
<img alt="email_template_form_cc_bcc" src="https://raw.githubusercontent.com/OCA/mail/18.0/mail_composer_cc_bcc/static/img/email_template_form_cc_bcc.png" /></blockquote>
</div>
<div class="section" id="usage">
<h3><a class="toc-backref" href="#toc-entry-2">Usage</a></h3>
<h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
<p>The partners cc and bcc from company form will be used to fill in mail
composer form.</p>
<blockquote>
Expand All @@ -428,25 +423,25 @@ <h3><a class="toc-backref" href="#toc-entry-2">Usage</a></h3>
<img alt="image1" src="https://raw.githubusercontent.com/OCA/mail/18.0/mail_composer_cc_bcc/static/img/mail_compose_message_template_cc_bcc.png" /></blockquote>
</div>
<div class="section" id="bug-tracker">
<h3><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h3>
<h2><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/mail/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/mail/issues/new?body=module:%20mail_composer_cc_bcc%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h3><a class="toc-backref" href="#toc-entry-4">Credits</a></h3>
<h2><a class="toc-backref" href="#toc-entry-4">Credits</a></h2>
</div>
</div>
<div class="section" id="authors">
<h2>Authors</h2>
<h1>Authors</h1>
<ul class="simple">
<li>Camptocamp</li>
</ul>
</div>
<div class="section" id="contributors">
<h2>Contributors</h2>
<h1>Contributors</h1>
<ul>
<li><p class="first"><a class="reference external" href="https://www.trobz.com">Trobz</a>:</p>
<blockquote>
Expand All @@ -457,17 +452,15 @@ <h2>Contributors</h2>
</ul>
</blockquote>
</li>
<li><p class="first">Alberto Nieto <a class="reference external" href="mailto:alberto.nieto&#64;braintec.com">alberto.nieto&#64;braintec.com</a> (<a class="reference external" href="https://braintec.com">https://braintec.com</a>)</p>
</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2>Other credits</h2>
<p>The creation and migration of this module from 16.0 to 17.0, and then
17.0 to 18.0 were financially supported by Camptocamp.</p>
<h1>Other credits</h1>
<p>The creation and migration from 16.0 to 17.0 of this module were
financially supported by Camptocamp.</p>
</div>
<div class="section" id="maintainers">
<h2>Maintainers</h2>
<h1>Maintainers</h1>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -481,6 +474,5 @@ <h2>Maintainers</h2>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>
Loading
Loading