Skip to content

Commit 5f7f087

Browse files
committed
[MIG] mail_composer_cc_bcc_account: Migration to 18.0
1 parent d71a240 commit 5f7f087

File tree

10 files changed

+157
-226
lines changed

10 files changed

+157
-226
lines changed

mail_composer_cc_bcc_account/README.rst

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ Email CC and BCC when sending invoice
1616
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
: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/17.0/mail_composer_cc_bcc_account
21-
:alt: OCA/social
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github
20+
:target: https://github.com/OCA/mail/tree/18.0/mail_composer_cc_bcc_account
21+
:alt: OCA/mail
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_composer_cc_bcc_account
23+
:target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_composer_cc_bcc_account
2424
:alt: Translate me on Weblate
2525
.. |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=17.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -56,10 +56,10 @@ partners then the invoice contact of the customer.
5656
Bug Tracker
5757
===========
5858

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

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

@@ -87,8 +87,8 @@ Contributors
8787
Other credits
8888
-------------
8989

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

9393
Maintainers
9494
-----------
@@ -111,6 +111,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
111111

112112
|maintainer-hailangvn2023|
113113

114-
This module is part of the `OCA/social <https://github.com/OCA/social/tree/17.0/mail_composer_cc_bcc_account>`_ project on GitHub.
114+
This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/18.0/mail_composer_cc_bcc_account>`_ project on GitHub.
115115

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

mail_composer_cc_bcc_account/__manifest__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
{
44
"name": "Email CC and BCC when sending invoice",
55
"summary": "This module enables sending mail to CC and BCC partners for invoices.",
6-
"version": "17.0.1.0.0",
6+
"version": "18.0.1.0.0",
77
"development_status": "Alpha",
88
"category": "Social",
9-
"website": "https://github.com/OCA/social",
9+
"website": "https://github.com/OCA/mail",
1010
"author": "Camptocamp SA, Odoo Community Association (OCA)",
1111
"maintainers": ["hailangvn2023"],
1212
"license": "AGPL-3",
@@ -19,6 +19,6 @@
1919
"mail_composer_cc_bcc",
2020
],
2121
"data": [
22-
"wizards/account_move_send.xml",
22+
"wizards/account_move_send_wizard.xml",
2323
],
2424
}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
The creation and migration from 16.0 to 17.0 of this module were
2-
financially supported by Camptocamp.
1+
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.

mail_composer_cc_bcc_account/static/description/index.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ <h1 class="title">Email CC and BCC when sending invoice</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:dd944995a010180b76d2bfa93b37c70a3866d21822b825cd811895aca5318ff6
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<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/social/tree/17.0/mail_composer_cc_bcc_account"><img alt="OCA/social" src="https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_composer_cc_bcc_account"><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/social&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<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_account"><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_account"><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>
373373
<p>This module allows to properly separate To:, Cc:, and Bcc: fields in
374374
when sending invoices.</p>
375375
<div class="admonition important">
@@ -405,10 +405,10 @@ <h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
405405
</div>
406406
<div class="section" id="bug-tracker">
407407
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
408-
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/social/issues">GitHub Issues</a>.
408+
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/mail/issues">GitHub Issues</a>.
409409
In case of trouble, please check there if your issue has already been reported.
410410
If you spotted it first, help us to smash it by providing a detailed and welcomed
411-
<a class="reference external" href="https://github.com/OCA/social/issues/new?body=module:%20mail_composer_cc_bcc_account%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
411+
<a class="reference external" href="https://github.com/OCA/mail/issues/new?body=module:%20mail_composer_cc_bcc_account%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
412412
<p>Do not contact contributors directly about support or help with technical issues.</p>
413413
</div>
414414
<div class="section" id="credits">
@@ -442,8 +442,8 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
442442
</div>
443443
<div class="section" id="other-credits">
444444
<h2><a class="toc-backref" href="#toc-entry-7">Other credits</a></h2>
445-
<p>The creation and migration from 16.0 to 17.0 of this module were
446-
financially supported by Camptocamp.</p>
445+
<p>The creation and migration of this module from 16.0 to 17.0, and then
446+
17.0 to 18.0 were financially supported by Camptocamp.</p>
447447
</div>
448448
<div class="section" id="maintainers">
449449
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
@@ -456,7 +456,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
456456
promote its widespread use.</p>
457457
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
458458
<p><a class="reference external image-reference" href="https://github.com/hailangvn2023"><img alt="hailangvn2023" src="https://github.com/hailangvn2023.png?size=40px" /></a></p>
459-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/social/tree/17.0/mail_composer_cc_bcc_account">OCA/social</a> project on GitHub.</p>
459+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/mail/tree/18.0/mail_composer_cc_bcc_account">OCA/mail</a> project on GitHub.</p>
460460
<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>
461461
</div>
462462
</div>
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,41 @@
11
# Copyright 2023 Camptocamp
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3-
from datetime import date
4-
5-
from odoo.tests import Form
6-
7-
from odoo.addons.mail_composer_cc_bcc.tests.test_mail_cc_bcc import TestMailCcBcc
8-
9-
10-
class TestMailCcBccInvoice(TestMailCcBcc):
11-
def open_invoice_mail_composer_form(self):
12-
# Use form to populate data
13-
# init invoice data
14-
self.test_invoice = test_record = self.test_account_move = self.env[
15-
"account.move"
16-
].create(
17-
{
18-
"invoice_date": date(2024, 3, 2),
19-
"invoice_date_due": date(2024, 3, 10),
20-
"invoice_line_ids": [
21-
(0, 0, {"name": "Line1", "price_unit": 100.0}),
22-
(0, 0, {"name": "Line2", "price_unit": 200.0}),
23-
],
24-
"move_type": "out_invoice",
25-
"name": "invoice test",
26-
"partner_id": self.env.ref("base.res_partner_2").id,
27-
}
28-
)
293

30-
self.assertTrue(
31-
self.test_invoice,
32-
"Test setup did not succeed. Invoice not found.",
33-
)
34-
self.test_invoice.write({"state": "posted"})
35-
36-
ctx = {
37-
"active_ids": test_record.ids,
38-
"default_model": "account.move",
39-
"default_res_id": test_record.id,
40-
"mail_notify_force_send": True,
41-
}
42-
form = Form(self.env["account.move.send"].with_context(**ctx))
43-
form.mail_body = "<p>Hello</p>"
44-
return form
4+
from odoo.tests import tagged
5+
6+
from odoo.addons.account.tests.test_account_move_send import TestAccountMoveSendCommon
7+
from odoo.addons.mail.tests.common import MailCommon
8+
9+
10+
@tagged("post_install_l10n", "post_install", "-at_install")
11+
class TestMailCcBccInvoice(TestAccountMoveSendCommon, MailCommon):
12+
@classmethod
13+
def setUpClass(cls):
14+
super().setUpClass()
15+
env = cls.env
16+
cls.partner = env.ref("base.res_partner_address_31")
17+
cls.partner_cc = env.ref("base.partner_demo")
18+
cls.partner_bcc = env.ref("base.res_partner_main2")
4519

4620
def test_invoice_mail_cc_bcc(self):
47-
self.set_company()
48-
form = self.open_invoice_mail_composer_form()
49-
form.mail_subject = "Hello"
50-
composer = form.save()
21+
invoice = self.init_invoice(
22+
"out_invoice", partner=self.partner, amounts=[1000], post=True
23+
)
24+
wizard = self.create_send_and_print(
25+
invoice,
26+
sending_methods=["email", "manual"],
27+
mail_partner_ids=self.partner,
28+
partner_cc_ids=self.partner_cc,
29+
partner_bcc_ids=self.partner_bcc,
30+
)
31+
5132
with self.mock_mail_gateway():
52-
composer.action_send_and_print()
53-
message = self.test_invoice.message_ids[0]
33+
wizard.action_send_and_print()
34+
self.assertEqual(len(self._mails), 3)
35+
36+
message = self._get_mail_message(invoice)
5437
self.assertEqual(len(message.mail_ids), 1)
5538

56-
# Only 2 partners (from default_cc/bcc of company) notified
57-
self.assertEqual(len(message.notified_partner_ids), 2)
58-
self.assertEqual(len(message.notification_ids), 2)
39+
# Only 3 partners (from default_cc/bcc of company) notified
40+
self.assertEqual(len(message.notified_partner_ids), 3)
41+
self.assertEqual(len(message.notification_ids), 3)
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from . import account_move_send
1+
from . import account_move_send_wizard

mail_composer_cc_bcc_account/wizards/account_move_send.py

-129
This file was deleted.

mail_composer_cc_bcc_account/wizards/account_move_send.xml

-25
This file was deleted.

0 commit comments

Comments
 (0)