Skip to content

Commit d4050bf

Browse files
[MIG] mail_partner_forwarding: Migration to 19.0
1 parent 989221e commit d4050bf

File tree

4 files changed

+57
-40
lines changed

4 files changed

+57
-40
lines changed

mail_partner_forwarding/README.rst

Lines changed: 10 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
Partner Mail Forwarding
37
=======================
@@ -13,17 +17,17 @@ Partner Mail Forwarding
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Production/Stable
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_partner_forwarding
24+
:target: https://github.com/OCA/mail/tree/19.0/mail_partner_forwarding
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_partner_forwarding
27+
:target: https://translation.odoo-community.org/projects/mail-19-0/mail-19-0-mail_partner_forwarding
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|
@@ -60,7 +64,7 @@ Bug Tracker
6064
Bugs are tracked on `GitHub Issues <https://github.com/OCA/mail/issues>`_.
6165
In case of trouble, please check there if your issue has already been reported.
6266
If you spotted it first, help us to smash it by providing a detailed and welcomed
63-
`feedback <https://github.com/OCA/mail/issues/new?body=module:%20mail_partner_forwarding%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
67+
`feedback <https://github.com/OCA/mail/issues/new?body=module:%20mail_partner_forwarding%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
6468

6569
Do not contact contributors directly about support or help with technical issues.
6670

@@ -90,6 +94,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
9094
mission is to support the collaborative development of Odoo features and
9195
promote its widespread use.
9296

93-
This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/18.0/mail_partner_forwarding>`_ project on GitHub.
97+
This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/19.0/mail_partner_forwarding>`_ project on GitHub.
9498

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

mail_partner_forwarding/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"name": "Partner Mail Forwarding",
66
"summary": "Forwarding notifications for partners",
7-
"version": "18.0.1.0.0",
7+
"version": "19.0.1.0.0",
88
"category": "Social Network",
99
"website": "https://github.com/OCA/mail",
1010
"author": "ADHOC SA, Odoo Community Association (OCA)",

mail_partner_forwarding/static/description/index.html

Lines changed: 20 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>Partner Mail Forwarding</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="partner-mail-forwarding">
364-
<h1 class="title">Partner Mail Forwarding</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="partner-mail-forwarding">
370+
<h1>Partner Mail Forwarding</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:3de166e53a25a592937445c5e63f963786fda5c8bf93804a885cfa1cb543ca97
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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_partner_forwarding"><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_partner_forwarding"><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="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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_partner_forwarding"><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_partner_forwarding"><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>This module allows to select a related user (called “Forwarding
374379
partner”) in each partner in order to send all the notifications to the
375380
Forwarding partner.</p>
@@ -391,7 +396,7 @@ <h1 class="title">Partner Mail Forwarding</h1>
391396
</ul>
392397
</div>
393398
<div class="section" id="usage">
394-
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
399+
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
395400
<p>To use this module, you need to:</p>
396401
<ul class="simple">
397402
<li>Install it.</li>
@@ -400,49 +405,50 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
400405
</ul>
401406
</div>
402407
<div class="section" id="changelog">
403-
<h1><a class="toc-backref" href="#toc-entry-2">Changelog</a></h1>
408+
<h2><a class="toc-backref" href="#toc-entry-2">Changelog</a></h2>
404409
<div class="section" id="section-1">
405-
<h2><a class="toc-backref" href="#toc-entry-3">13.0.1.0.0 (2022-01-03)</a></h2>
410+
<h3><a class="toc-backref" href="#toc-entry-3">13.0.1.0.0 (2022-01-03)</a></h3>
406411
<ul class="simple">
407412
<li>[NEW] Module in v13.</li>
408413
</ul>
409414
</div>
410415
</div>
411416
<div class="section" id="bug-tracker">
412-
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
417+
<h2><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h2>
413418
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/mail/issues">GitHub Issues</a>.
414419
In case of trouble, please check there if your issue has already been reported.
415420
If you spotted it first, help us to smash it by providing a detailed and welcomed
416-
<a class="reference external" href="https://github.com/OCA/mail/issues/new?body=module:%20mail_partner_forwarding%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
421+
<a class="reference external" href="https://github.com/OCA/mail/issues/new?body=module:%20mail_partner_forwarding%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
417422
<p>Do not contact contributors directly about support or help with technical issues.</p>
418423
</div>
419424
<div class="section" id="credits">
420-
<h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
425+
<h2><a class="toc-backref" href="#toc-entry-5">Credits</a></h2>
421426
<div class="section" id="authors">
422-
<h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
427+
<h3><a class="toc-backref" href="#toc-entry-6">Authors</a></h3>
423428
<ul class="simple">
424429
<li>ADHOC SA</li>
425430
</ul>
426431
</div>
427432
<div class="section" id="contributors">
428-
<h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
433+
<h3><a class="toc-backref" href="#toc-entry-7">Contributors</a></h3>
429434
<ul class="simple">
430435
<li>Nicolás Mac Rouillon &lt;<a class="reference external" href="mailto:nmr&#64;adhoc.com.ar">nmr&#64;adhoc.com.ar</a>&gt;</li>
431436
</ul>
432437
</div>
433438
<div class="section" id="maintainers">
434-
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
439+
<h3><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h3>
435440
<p>This module is maintained by the OCA.</p>
436441
<a class="reference external image-reference" href="https://odoo-community.org">
437442
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
438443
</a>
439444
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
440445
mission is to support the collaborative development of Odoo features and
441446
promote its widespread use.</p>
442-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/mail/tree/18.0/mail_partner_forwarding">OCA/mail</a> project on GitHub.</p>
447+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/mail/tree/19.0/mail_partner_forwarding">OCA/mail</a> project on GitHub.</p>
443448
<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>
444449
</div>
445450
</div>
446451
</div>
452+
</div>
447453
</body>
448454
</html>

mail_partner_forwarding/tests/test_mail_forwarding.py

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
22

3-
from odoo_test_helper import FakeModelLoader
4-
5-
from odoo import _
3+
from odoo.orm.model_classes import add_to_registry
64
from odoo.tests.common import TransactionCase, tagged
75

86

@@ -11,35 +9,44 @@ class TestMailForwarding(TransactionCase):
119
@classmethod
1210
def setUpClass(cls):
1311
super().setUpClass()
14-
# Setup env
1512
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
16-
# Load fake order model
17-
cls.loader = FakeModelLoader(cls.env, cls.__module__)
18-
cls.loader.backup_registry()
13+
1914
from .models.fake_order import FakeOrder
2015

21-
cls.loader.update_registry((FakeOrder,))
16+
add_to_registry(cls.registry, FakeOrder)
17+
18+
test_models = ["fake.order"]
19+
cls.registry._setup_models__(cls.env.cr, test_models)
20+
cls.registry.init_models(cls.env.cr, test_models, {"models_to_check": True})
21+
22+
for model_name in test_models:
23+
cls.addClassCleanup(cls.registry.__delitem__, model_name)
24+
2225
cls.fake_order_model = cls.env["ir.model"].search(
2326
[("model", "=", "fake.order")]
2427
)
25-
# Partner To forward
26-
cls.partner_1 = cls.env.ref("base.user_demo").partner_id
27-
cls.partner_2 = cls.env.ref("base.user_admin").partner_id
2828

29-
# Configurate in the user setting the user to be forwarding
29+
cls.partner_1 = cls.env["res.partner"].create(
30+
{
31+
"name": "Test Partner 1 (Forwarding)",
32+
"email": "partner1@test.example.com",
33+
}
34+
)
35+
cls.partner_2 = cls.env["res.partner"].create(
36+
{
37+
"name": "Test Partner 2 (Main)",
38+
"email": "partner2@test.example.com",
39+
}
40+
)
41+
3042
cls.partner_2.forwarding_partner_id = cls.partner_1
31-
# Empty fake.order
32-
cls.order = cls.env["fake.order"].create({"partner_id": cls.partner_2.id})
3343

34-
@classmethod
35-
def tearDownClass(cls):
36-
cls.loader.restore_registry()
37-
return super().tearDownClass()
44+
cls.order = cls.env["fake.order"].create({"partner_id": cls.partner_2.id})
3845

3946
def test_message_post_forwarding(self):
4047
"""Test forwarding when send a message for the user"""
4148
self.order.message_post(
42-
body=_("Test"),
49+
body=self.env._("Test"),
4350
message_type="comment",
4451
subtype_id=self.env.ref("mail.mt_comment").id,
4552
partner_ids=[self.partner_2.id],

0 commit comments

Comments
 (0)