Skip to content

Commit ad9529a

Browse files
committed
[MIG] mail_tracking_mass_mailing: Migration to 19.0
1 parent b613996 commit ad9529a

File tree

6 files changed

+53
-29
lines changed

6 files changed

+53
-29
lines changed

mail_tracking_mass_mailing/README.rst

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
==============================
26
Mail tracking for mass mailing
37
==============================
@@ -13,17 +17,17 @@ Mail tracking for mass mailing
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Beta
16-
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1822
:alt: License: AGPL-3
1923
.. |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_tracking_mass_mailing
24+
:target: https://github.com/OCA/mail/tree/19.0/mail_tracking_mass_mailing
2125
:alt: OCA/mail
2226
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_tracking_mass_mailing
27+
:target: https://translation.odoo-community.org/projects/mail-19-0/mail-19-0-mail_tracking_mass_mailing
2428
:alt: Translate me on Weblate
2529
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
: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
2731
:alt: Try me on Runboat
2832

2933
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -64,7 +68,7 @@ Bug Tracker
6468
Bugs are tracked on `GitHub Issues <https://github.com/OCA/mail/issues>`_.
6569
In case of trouble, please check there if your issue has already been reported.
6670
If you spotted it first, help us to smash it by providing a detailed and welcomed
67-
`feedback <https://github.com/OCA/mail/issues/new?body=module:%20mail_tracking_mass_mailing%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
71+
`feedback <https://github.com/OCA/mail/issues/new?body=module:%20mail_tracking_mass_mailing%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
6872

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

@@ -94,6 +98,10 @@ Contributors
9498
- nguyenhk <nguyenhk@trobz.com>
9599
- Tris Doan <tridm@trobz.com>
96100

101+
- `Komit <https://komit-consulting.com>`__:
102+
103+
- Quoc Pham Ngoc <quoc-pn@komit-consulting.com>
104+
97105
Other credits
98106
-------------
99107

@@ -113,6 +121,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
113121
mission is to support the collaborative development of Odoo features and
114122
promote its widespread use.
115123

116-
This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/18.0/mail_tracking_mass_mailing>`_ project on GitHub.
124+
This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/19.0/mail_tracking_mass_mailing>`_ project on GitHub.
117125

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

mail_tracking_mass_mailing/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
"name": "Mail tracking for mass mailing",
99
"summary": "Improve mass mailing email tracking",
10-
"version": "18.0.1.0.0",
10+
"version": "19.0.1.0.0",
1111
"category": "Social Network",
1212
"website": "https://github.com/OCA/mail",
1313
"author": "Tecnativa, Odoo Community Association (OCA)",

mail_tracking_mass_mailing/models/mail_mail.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _get_tracking_url(self):
2424
return False
2525

2626
def _postprocess_sent_message(
27-
self, success_pids, failure_reason=False, failure_type=None
27+
self, success_pids, success_emails, failure_reason=False, failure_type=None
2828
):
2929
"""Set mailing traces in error according to mail tracking state
3030
@@ -59,5 +59,5 @@ def _postprocess_sent_message(
5959
MailMail,
6060
self.with_context(_ignore_write_trace_postprocess_ids=processed_ids),
6161
)._postprocess_sent_message(
62-
success_pids, failure_reason=failure_reason, failure_type=failure_type
62+
success_pids, success_emails, failure_reason, failure_type
6363
)

mail_tracking_mass_mailing/readme/CONTRIBUTORS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010
- [Trobz](https://trobz.com):
1111
- nguyenhk \<<nguyenhk@trobz.com>\>
1212
- Tris Doan \<<tridm@trobz.com>\>
13+
14+
- [Komit](https://komit-consulting.com):
15+
- Quoc Pham Ngoc \<<quoc-pn@komit-consulting.com>\>

mail_tracking_mass_mailing/static/description/index.html

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>Mail tracking for mass mailing</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,16 +360,21 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="mail-tracking-for-mass-mailing">
364-
<h1 class="title">Mail tracking for mass mailing</h1>
363+
<div class="document">
365364

365+
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>
369+
<div class="section" id="mail-tracking-for-mass-mailing">
370+
<h1>Mail tracking for mass mailing</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:4c0589bdbbc642fc4bb1bf93ef961b1af0bd5820a6aee9a0218de746e537f869
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.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_tracking_mass_mailing"><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_tracking_mass_mailing"><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>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.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_tracking_mass_mailing"><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_tracking_mass_mailing"><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>
373378
<p>Links mail statistics objects with mail tracking objects.</p>
374379
<p><strong>Table of contents</strong></p>
375380
<div class="contents local topic" id="contents">
@@ -387,12 +392,12 @@ <h1 class="title">Mail tracking for mass mailing</h1>
387392
</ul>
388393
</div>
389394
<div class="section" id="installation">
390-
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
395+
<h2><a class="toc-backref" href="#toc-entry-1">Installation</a></h2>
391396
<p>This addon will be automatically installed when <tt class="docutils literal">mail_tracking</tt> and
392397
<tt class="docutils literal">mass_mailing</tt> are both installed.</p>
393398
</div>
394399
<div class="section" id="usage">
395-
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
400+
<h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
396401
<p>From mail statistic object, you can see:</p>
397402
<ul class="simple">
398403
<li>Email tracking state</li>
@@ -408,23 +413,23 @@ <h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
408413
mailing.</p>
409414
</div>
410415
<div class="section" id="bug-tracker">
411-
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
416+
<h2><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h2>
412417
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/mail/issues">GitHub Issues</a>.
413418
In case of trouble, please check there if your issue has already been reported.
414419
If you spotted it first, help us to smash it by providing a detailed and welcomed
415-
<a class="reference external" href="https://github.com/OCA/mail/issues/new?body=module:%20mail_tracking_mass_mailing%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
420+
<a class="reference external" href="https://github.com/OCA/mail/issues/new?body=module:%20mail_tracking_mass_mailing%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
416421
<p>Do not contact contributors directly about support or help with technical issues.</p>
417422
</div>
418423
<div class="section" id="credits">
419-
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
424+
<h2><a class="toc-backref" href="#toc-entry-4">Credits</a></h2>
420425
<div class="section" id="authors">
421-
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
426+
<h3><a class="toc-backref" href="#toc-entry-5">Authors</a></h3>
422427
<ul class="simple">
423428
<li>Tecnativa</li>
424429
</ul>
425430
</div>
426431
<div class="section" id="contributors">
427-
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
432+
<h3><a class="toc-backref" href="#toc-entry-6">Contributors</a></h3>
428433
<ul class="simple">
429434
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
430435
<li>Pedro M. Baeza</li>
@@ -441,26 +446,31 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
441446
<li>Tris Doan &lt;<a class="reference external" href="mailto:tridm&#64;trobz.com">tridm&#64;trobz.com</a>&gt;</li>
442447
</ul>
443448
</li>
449+
<li><a class="reference external" href="https://komit-consulting.com">Komit</a>:<ul>
450+
<li>Quoc Pham Ngoc &lt;<a class="reference external" href="mailto:quoc-pn&#64;komit-consulting.com">quoc-pn&#64;komit-consulting.com</a>&gt;</li>
451+
</ul>
452+
</li>
444453
</ul>
445454
</div>
446455
<div class="section" id="other-credits">
447-
<h2><a class="toc-backref" href="#toc-entry-7">Other credits</a></h2>
456+
<h3><a class="toc-backref" href="#toc-entry-7">Other credits</a></h3>
448457
<p>The migration of this module from 17.0 to 18.0 was financially supported
449458
by Camptocamp.</p>
450459
</div>
451460
<div class="section" id="maintainers">
452-
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
461+
<h3><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h3>
453462
<p>This module is maintained by the OCA.</p>
454463
<a class="reference external image-reference" href="https://odoo-community.org">
455464
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
456465
</a>
457466
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
458467
mission is to support the collaborative development of Odoo features and
459468
promote its widespread use.</p>
460-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/mail/tree/18.0/mail_tracking_mass_mailing">OCA/mail</a> project on GitHub.</p>
469+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/mail/tree/19.0/mail_tracking_mass_mailing">OCA/mail</a> project on GitHub.</p>
461470
<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>
462471
</div>
463472
</div>
464473
</div>
474+
</div>
465475
</body>
466476
</html>

mail_tracking_mass_mailing/tests/test_mass_mailing.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
from odoo.tests.common import TransactionCase, tagged
1010
from odoo.tools import mute_logger
1111

12-
from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
12+
from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT, MockSmtplibCase
1313

14-
mock_send_email = "odoo.addons.base.models.ir_mail_server.IrMailServer.send_email"
14+
mock_send_email = "odoo.addons.base.models.ir_mail_server.IrMail_Server.send_email"
1515

1616

1717
@tagged("-at_install", "post_install")
18-
class TestMassMailing(TransactionCase):
18+
class TestMassMailing(TransactionCase, MockSmtplibCase):
1919
@classmethod
2020
def setUpClass(cls):
2121
super().setUpClass()
@@ -47,7 +47,8 @@ def setUpClass(cls):
4747
def test_smtp_error(self):
4848
with mock.patch(mock_send_email) as mock_func:
4949
mock_func.side_effect = Warning("Mock test error")
50-
self.mailing.action_send_mail()
50+
with self.mock_smtplib_connection():
51+
self.mailing.action_send_mail()
5152
for stat in self.mailing.mailing_trace_ids:
5253
if stat.mail_mail_id:
5354
stat.mail_mail_id.send()
@@ -63,7 +64,8 @@ def test_smtp_error(self):
6364
self.assertTrue(self.contact_a.email_bounced)
6465

6566
def test_tracking_email_link(self):
66-
self.mailing.action_send_mail()
67+
with self.mock_smtplib_connection():
68+
self.mailing.action_send_mail()
6769
for stat in self.mailing.mailing_trace_ids:
6870
if stat.mail_mail_id:
6971
stat.mail_mail_id.send()
@@ -85,7 +87,8 @@ def test_tracking_email_link(self):
8587
self.assertEqual(stat.trace_status, "open")
8688

8789
def _tracking_email_bounce(self, event_type, state):
88-
self.mailing.action_send_mail()
90+
with self.mock_smtplib_connection():
91+
self.mailing.action_send_mail()
8992
for stat in self.mailing.mailing_trace_ids:
9093
if stat.mail_mail_id:
9194
stat.mail_mail_id.send()

0 commit comments

Comments
 (0)