Skip to content

Commit af5d8f3

Browse files
committed
[19.0][MIG] mail_composer_cc_bcc: Migration to 19.0
1 parent 4eaeeda commit af5d8f3

6 files changed

Lines changed: 41 additions & 37 deletions

File tree

mail_composer_cc_bcc/README.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Email CC and BCC
2121
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
2222
:alt: License: AGPL-3
2323
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github
24-
:target: https://github.com/OCA/mail/tree/18.0/mail_composer_cc_bcc
24+
:target: https://github.com/OCA/mail/tree/19.0/mail_composer_cc_bcc
2525
:alt: OCA/mail
2626
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_composer_cc_bcc
27+
:target: https://translation.odoo-community.org/projects/mail-19-0/mail-19-0-mail_composer_cc_bcc
2828
:alt: Translate me on Weblate
2929
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30-
:target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=19.0
3131
:alt: Try me on Runboat
3232

3333
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -72,8 +72,8 @@ In template form there are two fields to set cc and bcc emails.
7272

7373
|email_template_form_cc_bcc|
7474

75-
.. |res_company_form_default_cc_bcc| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_composer_cc_bcc/static/img/res_company_form_default_cc_bcc.png
76-
.. |email_template_form_cc_bcc| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_composer_cc_bcc/static/img/email_template_form_cc_bcc.png
75+
.. |res_company_form_default_cc_bcc| image:: https://raw.githubusercontent.com/OCA/mail/19.0/mail_composer_cc_bcc/static/img/res_company_form_default_cc_bcc.png
76+
.. |email_template_form_cc_bcc| image:: https://raw.githubusercontent.com/OCA/mail/19.0/mail_composer_cc_bcc/static/img/email_template_form_cc_bcc.png
7777

7878
Usage
7979
=====
@@ -89,16 +89,16 @@ corresponding mail composer's fields.
8989

9090
|image1|
9191

92-
.. |image| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_composer_cc_bcc/static/img/mail_compose_message_default_cc_bcc.png
93-
.. |image1| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_composer_cc_bcc/static/img/mail_compose_message_template_cc_bcc.png
92+
.. |image| image:: https://raw.githubusercontent.com/OCA/mail/19.0/mail_composer_cc_bcc/static/img/mail_compose_message_default_cc_bcc.png
93+
.. |image1| image:: https://raw.githubusercontent.com/OCA/mail/19.0/mail_composer_cc_bcc/static/img/mail_compose_message_template_cc_bcc.png
9494

9595
Bug Tracker
9696
===========
9797

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

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

@@ -148,6 +148,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
148148

149149
|maintainer-trisdoan|
150150

151-
This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/18.0/mail_composer_cc_bcc>`_ project on GitHub.
151+
This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/19.0/mail_composer_cc_bcc>`_ project on GitHub.
152152

153153
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

mail_composer_cc_bcc/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Email CC and BCC",
55
"summary": "This module enables sending mail to CC and BCC partners in mail composer form.", # noqa: E501
6-
"version": "18.0.1.0.2",
6+
"version": "19.0.1.0.0",
77
"development_status": "Alpha",
88
"category": "Social",
99
"website": "https://github.com/OCA/mail",

mail_composer_cc_bcc/models/mail_mail.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ class MailMail(models.Model):
2525

2626
email_bcc = fields.Char("Bcc", help="Blind Cc message recipients")
2727

28-
def _prepare_outgoing_list(
29-
self, mail_server=False, recipients_follower_status=None
30-
):
28+
# this method change on odoo 19.0
29+
# def _prepare_outgoing_list(self, mail_server=False, doc_to_followers=None):
30+
# TODO verify the code with the change doc_to_followers
31+
32+
def _prepare_outgoing_list(self, mail_server=False, doc_to_followers=None):
3133
# First, return if we're not coming from the Mail Composer
3234
res = super()._prepare_outgoing_list(
3335
mail_server=mail_server,
34-
recipients_follower_status=recipients_follower_status,
36+
doc_to_followers=doc_to_followers,
3537
)
3638
is_out_of_scope = len(self.ids) > 1
3739
is_from_composer = self.env.context.get("is_from_composer", False)

mail_composer_cc_bcc/models/mail_thread.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,20 @@ def _get_message_create_valid_field_names(self):
2525
# NOTIFICATION API
2626
# ------------------------------------------------------
2727

28-
def _notify_by_email_get_base_mail_values(self, message, additional_values=None):
28+
# this method change on odoo 19.0
29+
# def _notify_by_email_get_base_mail_values(self, message,
30+
# recipients_data, additional_values=None):
31+
# TODO verify the code with the change doc_to_followers
32+
33+
def _notify_by_email_get_base_mail_values(
34+
self, message, recipients_data, additional_values=None
35+
):
2936
"""
3037
This is to add cc, bcc addresses to mail.mail objects so that email
3138
can be sent to those addresses.
3239
"""
3340
res = super()._notify_by_email_get_base_mail_values(
34-
message, additional_values=additional_values
41+
message, recipients_data, additional_values=additional_values
3542
)
3643
context = self.env.context
3744
skip_adding_cc_bcc = context.get("skip_adding_cc_bcc", False)
@@ -48,7 +55,7 @@ def _notify_by_email_get_base_mail_values(self, message, additional_values=None)
4855

4956
return res
5057

51-
def _notify_get_recipients(self, message, msg_vals, **kwargs):
58+
def _notify_get_recipients(self, message, msg_vals=False, **kwargs):
5259
"""
5360
This is to add cc, bcc recipients so that they can be grouped with
5461
other recipients.

mail_composer_cc_bcc/static/description/index.html

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88

99
/*
1010
:Author: David Goodger (goodger@python.org)
11-
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
11+
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15-
Despite the name, some widely supported CSS2 features are used.
1615
1716
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1817
customize this style sheet.
@@ -275,7 +274,7 @@
275274
margin-left: 2em ;
276275
margin-right: 2em }
277276

278-
pre.code .ln { color: gray; } /* line numbers */
277+
pre.code .ln { color: grey; } /* line numbers */
279278
pre.code, code { background-color: #eeeeee }
280279
pre.code .comment, code .comment { color: #5C6576 }
281280
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +300,7 @@
301300
span.pre {
302301
white-space: pre }
303302

304-
span.problematic, pre.problematic {
303+
span.problematic {
305304
color: red }
306305

307306
span.section-subtitle {
@@ -363,9 +362,7 @@
363362
<div class="document">
364363

365364

366-
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367-
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368-
</a>
365+
<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>
369366
<div class="section" id="email-cc-and-bcc">
370367
<h1>Email CC and BCC</h1>
371368
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -374,7 +371,7 @@ <h1>Email CC and BCC</h1>
374371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375372
!! source digest: sha256:baa3864e6fc3754462520ec7eb76d0d09dbffbedbb627a99fe17c092ee3cf57f
376373
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377-
<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>
374+
<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/19.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-19-0/mail-19-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=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378375
<p>Odoo native does not support defining a Cc field in the Mail Composer by
379376
default; instead, it only has a unique Recipients fields, which is
380377
confusing for a lot of end users.</p>
@@ -410,29 +407,29 @@ <h2>Features</h2>
410407
<h3><a class="toc-backref" href="#toc-entry-1">Configuration</a></h3>
411408
<p>In company form there are two fields to set default cc and bcc partners.</p>
412409
<blockquote>
413-
<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>
410+
<img alt="res_company_form_default_cc_bcc" src="https://raw.githubusercontent.com/OCA/mail/19.0/mail_composer_cc_bcc/static/img/res_company_form_default_cc_bcc.png" /></blockquote>
414411
<p>In template form there are two fields to set cc and bcc emails.</p>
415412
<blockquote>
416-
<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>
413+
<img alt="email_template_form_cc_bcc" src="https://raw.githubusercontent.com/OCA/mail/19.0/mail_composer_cc_bcc/static/img/email_template_form_cc_bcc.png" /></blockquote>
417414
</div>
418415
<div class="section" id="usage">
419416
<h3><a class="toc-backref" href="#toc-entry-2">Usage</a></h3>
420417
<p>The partners cc and bcc from company form will be used to fill in mail
421418
composer form.</p>
422419
<blockquote>
423-
<img alt="image" src="https://raw.githubusercontent.com/OCA/mail/18.0/mail_composer_cc_bcc/static/img/mail_compose_message_default_cc_bcc.png" /></blockquote>
420+
<img alt="image" src="https://raw.githubusercontent.com/OCA/mail/19.0/mail_composer_cc_bcc/static/img/mail_compose_message_default_cc_bcc.png" /></blockquote>
424421
<p>When select a template that has cc and/or bcc emails, the emails will be
425422
used to lookup partners then found partners will be added to
426423
corresponding mail composer’s fields.</p>
427424
<blockquote>
428-
<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>
425+
<img alt="image1" src="https://raw.githubusercontent.com/OCA/mail/19.0/mail_composer_cc_bcc/static/img/mail_compose_message_template_cc_bcc.png" /></blockquote>
429426
</div>
430427
<div class="section" id="bug-tracker">
431428
<h3><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h3>
432429
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/mail/issues">GitHub Issues</a>.
433430
In case of trouble, please check there if your issue has already been reported.
434431
If you spotted it first, help us to smash it by providing a detailed and welcomed
435-
<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>
432+
<a class="reference external" href="https://github.com/OCA/mail/issues/new?body=module:%20mail_composer_cc_bcc%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
436433
<p>Do not contact contributors directly about support or help with technical issues.</p>
437434
</div>
438435
<div class="section" id="credits">
@@ -469,15 +466,13 @@ <h2>Other credits</h2>
469466
<div class="section" id="maintainers">
470467
<h2>Maintainers</h2>
471468
<p>This module is maintained by the OCA.</p>
472-
<a class="reference external image-reference" href="https://odoo-community.org">
473-
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
474-
</a>
469+
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
475470
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
476471
mission is to support the collaborative development of Odoo features and
477472
promote its widespread use.</p>
478473
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
479474
<p><a class="reference external image-reference" href="https://github.com/trisdoan"><img alt="trisdoan" src="https://github.com/trisdoan.png?size=40px" /></a></p>
480-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/mail/tree/18.0/mail_composer_cc_bcc">OCA/mail</a> project on GitHub.</p>
475+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/mail/tree/19.0/mail_composer_cc_bcc">OCA/mail</a> project on GitHub.</p>
481476
<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>
482477
</div>
483478
</div>

mail_composer_cc_bcc/tests/test_mail_cc_bcc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from odoo.addons.mail.tests.common import MailCase
1111
from odoo.addons.mail.tests.test_mail_composer import TestMailComposerForm
1212
from odoo.addons.mail.wizard.mail_compose_message import (
13-
MailComposer as MailComposer_upstream,
13+
MailComposeMessage as MailComposeMessage_upstream,
1414
)
1515

1616
VALID_HASHES = {
@@ -43,10 +43,10 @@ def open_mail_composer_form(self):
4343
form.body = "<p>Hello</p>"
4444
return form
4545

46-
def test_MailComposer_upstream_file_hash(self):
46+
def test_MailComposeMessage_upstream_file_hash(self):
4747
"""Test that copied upstream function hasn't received fixes"""
4848
_compute_partner_ids = inspect.getsource(
49-
MailComposer_upstream._compute_partner_ids
49+
MailComposeMessage_upstream._compute_partner_ids
5050
).encode()
5151
func_hash = hashlib.md5(_compute_partner_ids).hexdigest()
5252
self.assertIn(func_hash, VALID_HASHES.get("mail.composer:_compute_partner_ids"))

0 commit comments

Comments
 (0)