-
-
Notifications
You must be signed in to change notification settings - Fork 110
[MIG] mail_partner_forwarding: Migration to 19.0 #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
matiasperalta1
wants to merge
22
commits into
OCA:19.0
Choose a base branch
from
adhoc-dev:19.0-mig-mail_partner_forwarding
base: 19.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+988
−0
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a502154
[ADD] mail_partner_forwarding: New module
d19fcba
[UPD] Update mail_partner_forwarding.pot
25932a2
[UPD] README.rst
OCA-git-bot 80de134
[ADD] icon.png
OCA-git-bot 7f320e8
[UPD] README.rst
OCA-git-bot a76c745
[IMP] mail_partner_forwarding: pre-commit execution
augusto-weiss 0d518d9
[MIG] mail_partner_forwarding: Migration to 17.0
augusto-weiss 8a83d08
[UPD] Update mail_partner_forwarding.pot
5120bb4
[BOT] post-merge updates
OCA-git-bot 22572f3
Added translation using Weblate (Italian)
mymage 439132a
Translated using Weblate (Italian)
mymage de5674b
Added translation using Weblate (Spanish)
Ivorra78 49b548d
Translated using Weblate (Spanish)
Ivorra78 6211ffb
[UPD] copier version 1.20
2aa57aa
[BOT] post-merge updates
OCA-git-bot 2488552
[IMP] mail_partner_forwarding: pre-commit execution
lef-adhoc c535571
[MIG] mail_partner_forwarding: Migration to 18.0
lef-adhoc 2b448e2
[UPD] Update mail_partner_forwarding.pot
4b1da6c
[BOT] post-merge updates
OCA-git-bot 583bf16
Added translation using Weblate (German)
NICO-SOLUTIONS 989221e
Translated using Weblate (German)
NICO-SOLUTIONS 0488524
[MIG] mail_partner_forwarding: Migration to 19.0
matiasperalta1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| .. image:: https://odoo-community.org/readme-banner-image | ||
| :target: https://odoo-community.org/get-involved?utm_source=readme | ||
| :alt: Odoo Community Association | ||
|
|
||
| ======================= | ||
| Partner Mail Forwarding | ||
| ======================= | ||
|
|
||
| .. | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:3de166e53a25a592937445c5e63f963786fda5c8bf93804a885cfa1cb543ca97 | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png | ||
| :target: https://odoo-community.org/page/development-status | ||
| :alt: Production/Stable | ||
| .. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png | ||
| :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
| :alt: License: AGPL-3 | ||
| .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github | ||
| :target: https://github.com/OCA/mail/tree/19.0/mail_partner_forwarding | ||
| :alt: OCA/mail | ||
| .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
| :target: https://translation.odoo-community.org/projects/mail-19-0/mail-19-0-mail_partner_forwarding | ||
| :alt: Translate me on Weblate | ||
| .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
| :target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=19.0 | ||
| :alt: Try me on Runboat | ||
|
|
||
| |badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
|
||
| This module allows to select a related user (called "Forwarding | ||
| partner") in each partner in order to send all the notifications to the | ||
| Forwarding partner. | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Usage | ||
| ===== | ||
|
|
||
| To use this module, you need to: | ||
|
|
||
| - Install it. | ||
| - Set a Forwarding partner in your partner. | ||
| - Your Forwarding partner also will be notify of your notifications | ||
|
|
||
| Changelog | ||
| ========= | ||
|
|
||
| 13.0.1.0.0 (2022-01-03) | ||
| ----------------------- | ||
|
|
||
| - [NEW] Module in v13. | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues <https://github.com/OCA/mail/issues>`_. | ||
| In case of trouble, please check there if your issue has already been reported. | ||
| If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
| `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**>`_. | ||
|
|
||
| Do not contact contributors directly about support or help with technical issues. | ||
|
|
||
| Credits | ||
| ======= | ||
|
|
||
| Authors | ||
| ------- | ||
|
|
||
| * ADHOC SA | ||
|
|
||
| Contributors | ||
| ------------ | ||
|
|
||
| - Nicolás Mac Rouillon <[email protected]> | ||
|
|
||
| Maintainers | ||
| ----------- | ||
|
|
||
| This module is maintained by the OCA. | ||
|
|
||
| .. image:: https://odoo-community.org/logo.png | ||
| :alt: Odoo Community Association | ||
| :target: https://odoo-community.org | ||
|
|
||
| OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
| mission is to support the collaborative development of Odoo features and | ||
| promote its widespread use. | ||
|
|
||
| This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/19.0/mail_partner_forwarding>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Copyright 2022 AdHoc SA - Pablo Paez | ||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
|
||
| { | ||
| "name": "Partner Mail Forwarding", | ||
| "summary": "Forwarding notifications for partners", | ||
| "version": "19.0.1.0.0", | ||
| "category": "Social Network", | ||
| "website": "https://github.com/OCA/mail", | ||
| "author": "ADHOC SA, Odoo Community Association (OCA)", | ||
| "license": "AGPL-3", | ||
| "installable": True, | ||
| "depends": ["mail"], | ||
| "data": ["views/res_user_views.xml", "views/res_partner_views.xml"], | ||
| "development_status": "Production/Stable", | ||
| "maintainers": [], | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * mail_partner_forwarding | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 18.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "PO-Revision-Date: 2025-03-20 11:53+0000\n" | ||
| "Last-Translator: Nils Coenen <[email protected]>\n" | ||
| "Language-Team: none\n" | ||
| "Language: de\n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: \n" | ||
| "Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
| "X-Generator: Weblate 5.10.2\n" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model,name:mail_partner_forwarding.model_res_partner | ||
| msgid "Contact" | ||
| msgstr "Kontakt" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model,name:mail_partner_forwarding.model_mail_thread | ||
| msgid "Email Thread" | ||
| msgstr "" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model.fields,field_description:mail_partner_forwarding.field_res_partner__forwarding_partner_id | ||
| #: model:ir.model.fields,field_description:mail_partner_forwarding.field_res_users__forwarding_partner_id | ||
| msgid "Forwarding Partner" | ||
| msgstr "Weiterleitungspartner" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model.fields,help:mail_partner_forwarding.field_res_partner__forwarding_partner_id | ||
| #: model:ir.model.fields,help:mail_partner_forwarding.field_res_users__forwarding_partner_id | ||
| msgid "" | ||
| "Messages will be forwarded only for partners that are followers but no " | ||
| "partners being notify because they belong to channel that is following the " | ||
| "thread" | ||
| msgstr "" | ||
| "Nachrichten werden nur an Partner weitergeleitet die Follower sind, aber es " | ||
| "werden keine Partner benachrichtigt, weil sie zum Kanal gehören, der dem " | ||
| "Thread folgt" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #. odoo-python | ||
| #: code:addons/mail_partner_forwarding/tests/test_mail_forwarding.py:0 | ||
| msgid "Test" | ||
| msgstr "" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model,name:mail_partner_forwarding.model_res_users | ||
| msgid "User" | ||
| msgstr "Benutzer" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * mail_partner_forwarding | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 17.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "PO-Revision-Date: 2024-02-08 19:35+0000\n" | ||
| "Last-Translator: Ivorra78 <[email protected]>\n" | ||
| "Language-Team: none\n" | ||
| "Language: es\n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: \n" | ||
| "Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
| "X-Generator: Weblate 4.17\n" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model,name:mail_partner_forwarding.model_res_partner | ||
| msgid "Contact" | ||
| msgstr "Contacto" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model,name:mail_partner_forwarding.model_mail_thread | ||
| msgid "Email Thread" | ||
| msgstr "Hilo de Correo Electrónico" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model.fields,field_description:mail_partner_forwarding.field_res_partner__forwarding_partner_id | ||
| #: model:ir.model.fields,field_description:mail_partner_forwarding.field_res_users__forwarding_partner_id | ||
| msgid "Forwarding Partner" | ||
| msgstr "Socio Transitario" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model.fields,help:mail_partner_forwarding.field_res_partner__forwarding_partner_id | ||
| #: model:ir.model.fields,help:mail_partner_forwarding.field_res_users__forwarding_partner_id | ||
| msgid "" | ||
| "Messages will be forwarded only for partners that are followers but no " | ||
| "partners being notify because they belong to channel that is following the " | ||
| "thread" | ||
| msgstr "" | ||
| "Los mensajes sólo se reenviarán a los socios que sean seguidores, pero no se " | ||
| "notificará a los socios que pertenezcan a un canal que esté siguiendo el hilo" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #. odoo-python | ||
| #: code:addons/mail_partner_forwarding/tests/test_mail_forwarding.py:0 | ||
| #, python-format | ||
| msgid "Test" | ||
| msgstr "Prueba" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model,name:mail_partner_forwarding.model_res_users | ||
| msgid "User" | ||
| msgstr "Usuario" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * mail_partner_forwarding | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 17.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "PO-Revision-Date: 2024-02-04 22:34+0000\n" | ||
| "Last-Translator: mymage <[email protected]>\n" | ||
| "Language-Team: none\n" | ||
| "Language: it\n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: \n" | ||
| "Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
| "X-Generator: Weblate 4.17\n" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model,name:mail_partner_forwarding.model_res_partner | ||
| msgid "Contact" | ||
| msgstr "Contatto" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model,name:mail_partner_forwarding.model_mail_thread | ||
| msgid "Email Thread" | ||
| msgstr "Discussione e-mail" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model.fields,field_description:mail_partner_forwarding.field_res_partner__forwarding_partner_id | ||
| #: model:ir.model.fields,field_description:mail_partner_forwarding.field_res_users__forwarding_partner_id | ||
| msgid "Forwarding Partner" | ||
| msgstr "Partner inoltro" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model.fields,help:mail_partner_forwarding.field_res_partner__forwarding_partner_id | ||
| #: model:ir.model.fields,help:mail_partner_forwarding.field_res_users__forwarding_partner_id | ||
| msgid "" | ||
| "Messages will be forwarded only for partners that are followers but no " | ||
| "partners being notify because they belong to channel that is following the " | ||
| "thread" | ||
| msgstr "" | ||
| "I messaggi verranno inoltrati solo per partner che seguono ma nessun partner " | ||
| "è stato avvisato perché apprtiene al canale che segue la discussione" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #. odoo-python | ||
| #: code:addons/mail_partner_forwarding/tests/test_mail_forwarding.py:0 | ||
| #, python-format | ||
| msgid "Test" | ||
| msgstr "Test" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model,name:mail_partner_forwarding.model_res_users | ||
| msgid "User" | ||
| msgstr "Utente" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * mail_partner_forwarding | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 18.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "Last-Translator: \n" | ||
| "Language-Team: \n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: \n" | ||
| "Plural-Forms: \n" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model,name:mail_partner_forwarding.model_res_partner | ||
| msgid "Contact" | ||
| msgstr "" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model,name:mail_partner_forwarding.model_mail_thread | ||
| msgid "Email Thread" | ||
| msgstr "" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model.fields,field_description:mail_partner_forwarding.field_res_partner__forwarding_partner_id | ||
| #: model:ir.model.fields,field_description:mail_partner_forwarding.field_res_users__forwarding_partner_id | ||
| msgid "Forwarding Partner" | ||
| msgstr "" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model.fields,help:mail_partner_forwarding.field_res_partner__forwarding_partner_id | ||
| #: model:ir.model.fields,help:mail_partner_forwarding.field_res_users__forwarding_partner_id | ||
| msgid "" | ||
| "Messages will be forwarded only for partners that are followers but no " | ||
| "partners being notify because they belong to channel that is following the " | ||
| "thread" | ||
| msgstr "" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #. odoo-python | ||
| #: code:addons/mail_partner_forwarding/tests/test_mail_forwarding.py:0 | ||
| msgid "Test" | ||
| msgstr "" | ||
|
|
||
| #. module: mail_partner_forwarding | ||
| #: model:ir.model,name:mail_partner_forwarding.model_res_users | ||
| msgid "User" | ||
| msgstr "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from . import res_partner | ||
| from . import res_user | ||
| from . import mail_thread |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| from odoo import models | ||
|
|
||
|
|
||
| class MailThread(models.AbstractModel): | ||
| _inherit = "mail.thread" | ||
|
|
||
| def _notify_get_recipients(self, message, msg_vals, **kwargs): | ||
| """Inherit this method to add in the list of partners to be notify | ||
| the forwarding_partner_id of any partners in the list""" | ||
| recipient_data = super()._notify_get_recipients(message, msg_vals, **kwargs) | ||
| if not recipient_data: | ||
| return recipient_data | ||
| partner_dict = {x.get("id"): x for x in recipient_data} | ||
| forwarded_partner_ids = [] | ||
| # for each partner being notified we check if it has a | ||
| # forwarding_partner_id configured that is not being notified yet | ||
| for partner in ( | ||
| self.env["res.partner"] | ||
| .sudo() | ||
| .with_context(prefetch_fields=False) | ||
| .browse(partner_dict.keys()) | ||
| ): | ||
| if ( | ||
| partner.forwarding_partner_id | ||
| and partner.forwarding_partner_id.id not in partner_dict.keys() | ||
| and partner.forwarding_partner_id.id not in forwarded_partner_ids | ||
| ): | ||
| forwarded_partner_ids.append(partner.forwarding_partner_id.id) | ||
| data = partner_dict[partner.id].copy() | ||
| notif = ( | ||
| partner.forwarding_partner_id.user_ids | ||
| and partner.forwarding_partner_id.user_ids[0].notification_type | ||
| or "email" | ||
| ) | ||
| data.update( | ||
| { | ||
| "id": partner.forwarding_partner_id.id, | ||
| "share": partner.partner_share, | ||
| "notif": notif, | ||
| } | ||
| ) | ||
| recipient_data.append(data) | ||
| return recipient_data | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'share' field is being set using 'partner.partner_share' (the original partner), but it should be using 'partner.forwarding_partner_id.partner_share' (the forwarding partner's share status). This could cause incorrect permission handling when the forwarding partner has a different share status than the original partner.