Skip to content

Commit 2d8d153

Browse files
committed
[18.0][MIG] mass_mailing_partner: Migration to 18.0
1 parent 5a94d48 commit 2d8d153

File tree

9 files changed

+47
-27
lines changed

9 files changed

+47
-27
lines changed

Diff for: mass_mailing_partner/README.rst

+9-5
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Link partners with mass-mailing
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github
20-
:target: https://github.com/OCA/social/tree/17.0/mass_mailing_partner
20+
:target: https://github.com/OCA/social/tree/18.0/mass_mailing_partner
2121
:alt: OCA/social
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-mass_mailing_partner
23+
:target: https://translation.odoo-community.org/projects/social-18-0/social-18-0-mass_mailing_partner
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/social&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -65,7 +65,7 @@ Bug Tracker
6565
Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_.
6666
In case of trouble, please check there if your issue has already been reported.
6767
If you spotted it first, help us to smash it by providing a detailed and welcomed
68-
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mass_mailing_partner%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
68+
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mass_mailing_partner%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
6969

7070
Do not contact contributors directly about support or help with technical issues.
7171

@@ -99,6 +99,10 @@ Contributors
9999

100100
- Nguyễn Minh Chiến <[email protected]>
101101

102+
- `360ERP <https://www.360erp.com>`__:
103+
104+
- Kevin Khao
105+
102106
Other credits
103107
-------------
104108

@@ -118,6 +122,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
118122
mission is to support the collaborative development of Odoo features and
119123
promote its widespread use.
120124

121-
This module is part of the `OCA/social <https://github.com/OCA/social/tree/17.0/mass_mailing_partner>`_ project on GitHub.
125+
This module is part of the `OCA/social <https://github.com/OCA/social/tree/18.0/mass_mailing_partner>`_ project on GitHub.
122126

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

Diff for: mass_mailing_partner/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
{
88
"name": "Link partners with mass-mailing",
9-
"version": "17.0.1.0.0",
9+
"version": "18.0.1.0.0",
1010
"author": "Tecnativa, " "Odoo Community Association (OCA)",
1111
"website": "https://github.com/OCA/social",
1212
"license": "AGPL-3",

Diff for: mass_mailing_partner/models/mailing_contact.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright 2020 Hibou Corp.
77
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
88

9-
from odoo import _, api, fields, models
9+
from odoo import api, fields, models
1010
from odoo.exceptions import ValidationError
1111

1212

@@ -38,8 +38,10 @@ def _check_partner_id_list_ids(self):
3838
)
3939
if contact.list_ids & other_contact.mapped("list_ids"):
4040
raise ValidationError(
41-
_("Partner already exists in one of these mailing lists")
42-
+ ": %s" % contact.partner_id.display_name
41+
self.env._(
42+
f"Partner already exists in one of these mailing lists: "
43+
f"{contact.partner_id.display_name}"
44+
)
4345
)
4446

4547
@api.onchange("partner_id")

Diff for: mass_mailing_partner/models/mailing_list.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Copyright 2020 Tecnativa - Manuel Calero
55
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
66

7-
from odoo import _, api, fields, models
7+
from odoo import api, fields, models
88
from odoo.exceptions import ValidationError
99

1010

@@ -30,5 +30,5 @@ def _check_contact_ids_partner_id(self):
3030
)
3131
if len(list(filter(lambda r: r["partner_id_count"] > 1, data))):
3232
raise ValidationError(
33-
_("A partner cannot be multiple times " "in the same list")
33+
self.env._("A partner cannot be multiple times " "in the same list")
3434
)

Diff for: mass_mailing_partner/models/mailing_subscription.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2020 Tecnativa - Manuel Calero
33
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
44

5-
from odoo import _, api, models
5+
from odoo import api, models
66
from odoo.exceptions import ValidationError
77

88

@@ -16,5 +16,7 @@ def _check_contact_id_partner_id_list_id(self):
1616
contacts = rel.list_id.contact_ids - rel.contact_id
1717
if rel.contact_id.partner_id in contacts.mapped("partner_id"):
1818
raise ValidationError(
19-
_("A partner cannot be multiple times in the same list")
19+
self.env._(
20+
"A partner cannot be multiple times in the same list"
21+
)
2022
)

Diff for: mass_mailing_partner/models/res_partner.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Copyright 2020 Tecnativa - Manuel Calero
66
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
77

8-
from odoo import _, api, fields, models
8+
from odoo import api, fields, models
99
from odoo.exceptions import ValidationError
1010

1111

@@ -39,11 +39,10 @@ def _check_email_mass_mailing_contacts(self):
3939
for partner in self:
4040
if not partner.email and partner.sudo().mass_mailing_contact_ids:
4141
raise ValidationError(
42-
_(
43-
"This partner '%s' is linked to one or more mass "
44-
"mailing contact. Email must be assigned."
42+
self.env._(
43+
f"This partner '{partner.name}' is linked to one or more mass "
44+
f"mailing contact. Email must be assigned."
4545
)
46-
% partner.name
4746
)
4847

4948
@api.depends("mass_mailing_contact_ids")

Diff for: mass_mailing_partner/readme/CONTRIBUTORS.md

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616
- [Trobz](https://trobz.com):
1717

1818
> - Nguyễn Minh Chiến \<<[email protected]>\>
19+
20+
- [360ERP](https://www.360erp.com):
21+
> - Kevin Khao

Diff for: mass_mailing_partner/static/description/index.html

+17-7
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
/*
1010
:Author: David Goodger ([email protected])
11-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z 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.
1516
1617
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1718
customize this style sheet.
@@ -274,7 +275,7 @@
274275
margin-left: 2em ;
275276
margin-right: 2em }
276277

277-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
278279
pre.code, code { background-color: #eeeeee }
279280
pre.code .comment, code .comment { color: #5C6576 }
280281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@
300301
span.pre {
301302
white-space: pre }
302303

303-
span.problematic {
304+
span.problematic, pre.problematic {
304305
color: red }
305306

306307
span.section-subtitle {
@@ -368,7 +369,7 @@ <h1 class="title">Link partners with mass-mailing</h1>
368369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369370
!! source digest: sha256:8083c5d47fc4880c6cf6633ba03e280336b7e52ba8e332f37b5a1f876bbf20e7
370371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371-
<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/social/tree/17.0/mass_mailing_partner"><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-mass_mailing_partner"><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="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/social/tree/18.0/mass_mailing_partner"><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-18-0/social-18-0-mass_mailing_partner"><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=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372373
<p>This module links mass-mailing contacts with partners.</p>
373374
<div class="section" id="features">
374375
<h1>Features</h1>
@@ -406,7 +407,7 @@ <h2><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h2>
406407
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/social/issues">GitHub Issues</a>.
407408
In case of trouble, please check there if your issue has already been reported.
408409
If you spotted it first, help us to smash it by providing a detailed and welcomed
409-
<a class="reference external" href="https://github.com/OCA/social/issues/new?body=module:%20mass_mailing_partner%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
410+
<a class="reference external" href="https://github.com/OCA/social/issues/new?body=module:%20mass_mailing_partner%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
410411
<p>Do not contact contributors directly about support or help with technical issues.</p>
411412
</div>
412413
<div class="section" id="credits">
@@ -447,6 +448,13 @@ <h1>Contributors</h1>
447448
</ul>
448449
</blockquote>
449450
</li>
451+
<li><p class="first"><a class="reference external" href="https://www.360erp.com">360ERP</a>:</p>
452+
<blockquote>
453+
<ul class="simple">
454+
<li>Kevin Khao</li>
455+
</ul>
456+
</blockquote>
457+
</li>
450458
</ul>
451459
</div>
452460
<div class="section" id="other-credits">
@@ -457,11 +465,13 @@ <h1>Other credits</h1>
457465
<div class="section" id="maintainers">
458466
<h1>Maintainers</h1>
459467
<p>This module is maintained by the OCA.</p>
460-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
468+
<a class="reference external image-reference" href="https://odoo-community.org">
469+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
470+
</a>
461471
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
462472
mission is to support the collaborative development of Odoo features and
463473
promote its widespread use.</p>
464-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/social/tree/17.0/mass_mailing_partner">OCA/social</a> project on GitHub.</p>
474+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/social/tree/18.0/mass_mailing_partner">OCA/social</a> project on GitHub.</p>
465475
<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>
466476
</div>
467477
</div>

Diff for: mass_mailing_partner/wizard/partner_mail_list_wizard.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Copyright 2020 Tecnativa - Manuel Calero
55
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
66

7-
from odoo import _, fields, models
7+
from odoo import fields, models
88
from odoo.exceptions import UserError
99

1010

@@ -32,7 +32,7 @@ def add_to_mail_list(self):
3232
to_create = partners - add_list
3333
for partner in to_create:
3434
if not partner.email:
35-
raise UserError(_("Partner '%s' has no email.") % partner.name)
35+
raise UserError(self.env._(f"Partner '{partner.name}' has no email."))
3636
contact_vals = {
3737
"partner_id": partner.id,
3838
"list_ids": [(4, self.mail_list_id.id)],

0 commit comments

Comments
 (0)