From 8ab1446a573e9b144e4a627299970d4d71bf6695 Mon Sep 17 00:00:00 2001
From: Carlos Lopez
Date: Tue, 1 Oct 2024 14:32:16 -0500
Subject: [PATCH 01/44] [ADD] mail_forward: new module to forward messages from
the chatter
---
mail_forward/README.rst | 90 ++++
mail_forward/__init__.py | 2 +
mail_forward/__manifest__.py | 27 ++
mail_forward/i18n/es.po | 83 ++++
mail_forward/i18n/mail_forward.pot | 101 ++++
mail_forward/models/__init__.py | 2 +
mail_forward/models/mail_message.py | 57 +++
mail_forward/models/mail_thread.py | 19 +
mail_forward/readme/CONTRIBUTORS.rst | 2 +
mail_forward/readme/DESCRIPTION.rst | 2 +
mail_forward/readme/USAGE.rst | 8 +
mail_forward/static/description/icon.png | Bin 0 -> 9455 bytes
mail_forward/static/description/index.html | 444 ++++++++++++++++++
.../forward_message/forward_message.esm.js | 44 ++
.../forward_message/forward_message.xml | 32 ++
.../message_action_list.xml | 12 +
.../static/tests/tours/mail_forward.esm.js | 116 +++++
mail_forward/tests/__init__.py | 1 +
mail_forward/tests/test_mail_forward.py | 77 +++
mail_forward/wizards/__init__.py | 1 +
mail_forward/wizards/mail_compose_message.py | 39 ++
.../wizards/mail_compose_message_view.xml | 27 ++
22 files changed, 1186 insertions(+)
create mode 100644 mail_forward/README.rst
create mode 100644 mail_forward/__init__.py
create mode 100644 mail_forward/__manifest__.py
create mode 100644 mail_forward/i18n/es.po
create mode 100644 mail_forward/i18n/mail_forward.pot
create mode 100644 mail_forward/models/__init__.py
create mode 100644 mail_forward/models/mail_message.py
create mode 100644 mail_forward/models/mail_thread.py
create mode 100644 mail_forward/readme/CONTRIBUTORS.rst
create mode 100644 mail_forward/readme/DESCRIPTION.rst
create mode 100644 mail_forward/readme/USAGE.rst
create mode 100644 mail_forward/static/description/icon.png
create mode 100644 mail_forward/static/description/index.html
create mode 100644 mail_forward/static/src/components/forward_message/forward_message.esm.js
create mode 100644 mail_forward/static/src/components/forward_message/forward_message.xml
create mode 100644 mail_forward/static/src/components/message_action_list/message_action_list.xml
create mode 100644 mail_forward/static/tests/tours/mail_forward.esm.js
create mode 100644 mail_forward/tests/__init__.py
create mode 100644 mail_forward/tests/test_mail_forward.py
create mode 100644 mail_forward/wizards/__init__.py
create mode 100644 mail_forward/wizards/mail_compose_message.py
create mode 100644 mail_forward/wizards/mail_compose_message_view.xml
diff --git a/mail_forward/README.rst b/mail_forward/README.rst
new file mode 100644
index 000000000..99c7b20a1
--- /dev/null
+++ b/mail_forward/README.rst
@@ -0,0 +1,90 @@
+====================
+Mail Forward Message
+====================
+
+..
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! source digest: sha256:ce6348512860de33703c2523bb1131aa2bb23a10374db4fb6f66383a7933134f
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
+ :target: https://odoo-community.org/page/development-status
+ :alt: Beta
+.. |badge2| image:: https://img.shields.io/badge/licence-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%2Fsocial-lightgray.png?logo=github
+ :target: https://github.com/OCA/social/tree/15.0/mail_forward
+ :alt: OCA/social
+.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
+ :target: https://translation.odoo-community.org/projects/social-15-0/social-15-0-mail_forward
+ :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/social&target_branch=15.0
+ :alt: Try me on Runboat
+
+|badge1| |badge2| |badge3| |badge4| |badge5|
+
+This module allows users to forward messages from the chatter of any document to other users,
+adding them as followers of the document without notifying the current followers.
+
+**Table of contents**
+
+.. contents::
+ :local:
+
+Usage
+=====
+
+To use this module, follow these steps:
+
+* Navigate to the chatter of any document.
+* Hover the mouse over any message in the chatter (excluding internal notes).
+* A Forward icon will appear next to the message.
+* Click the button to display a wizard with the message.
+* Select the users to forward the message to.
+* Click the 'Send Mail' button to send the message to the selected users.
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub 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 `_.
+
+Do not contact contributors directly about support or help with technical issues.
+
+Credits
+=======
+
+Authors
+~~~~~~~
+
+* Tecnativa
+
+Contributors
+~~~~~~~~~~~~
+
+* `Tecnativa `_:
+ * Carlos López
+
+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/social `_ project on GitHub.
+
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/mail_forward/__init__.py b/mail_forward/__init__.py
new file mode 100644
index 000000000..aee8895e7
--- /dev/null
+++ b/mail_forward/__init__.py
@@ -0,0 +1,2 @@
+from . import models
+from . import wizards
diff --git a/mail_forward/__manifest__.py b/mail_forward/__manifest__.py
new file mode 100644
index 000000000..d693cfb9c
--- /dev/null
+++ b/mail_forward/__manifest__.py
@@ -0,0 +1,27 @@
+# Copyright 2024 Tecnativa - Carlos Lopez
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+{
+ "name": "Mail Forward Message",
+ "version": "15.0.1.0.0",
+ "summary": "Forward messages from the chatter of any document to other users.",
+ "author": "Tecnativa, Odoo Community Association (OCA)",
+ "website": "https://github.com/OCA/social",
+ "depends": ["mail", "contacts"],
+ "data": [
+ "wizards/mail_compose_message_view.xml",
+ ],
+ "assets": {
+ "web.assets_backend": [
+ "mail_forward/static/src/components/**/*.esm.js",
+ ],
+ "web.assets_qweb": [
+ "mail_forward/static/src/components/*/*.xml",
+ ],
+ "web.assets_tests": [
+ "mail_forward/static/tests/tours/**/*",
+ ],
+ },
+ "installable": True,
+ "auto_install": False,
+ "license": "AGPL-3",
+}
diff --git a/mail_forward/i18n/es.po b/mail_forward/i18n/es.po
new file mode 100644
index 000000000..c33ce8127
--- /dev/null
+++ b/mail_forward/i18n/es.po
@@ -0,0 +1,83 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * mail_forward
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 15.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2024-10-02 12:25+0000\n"
+"PO-Revision-Date: 2024-10-02 07:27-0500\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 3.0.1\n"
+
+#. module: mail_forward
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "---------- Forwarded message ---------"
+msgstr "---------- Mensaje reenviado ---------"
+
+#. module: mail_forward
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "Date"
+msgstr "Fecha"
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_mail_thread
+msgid "Email Thread"
+msgstr "Hilo de correos electrónicos"
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_mail_compose_message
+msgid "Email composition wizard"
+msgstr "Asistente de composición de correos electrónicos"
+
+#. module: mail_forward
+#. openerp-web
+#: code:addons/mail_forward/models/mail_message.py:0
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message"
+msgstr "Reenviar mensaje"
+
+#. module: mail_forward
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "From"
+msgstr "De"
+
+#. module: mail_forward
+#: code:addons/mail_forward/wizards/mail_compose_message.py:0
+#, python-format
+msgid "Fwd:"
+msgstr ""
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_mail_message
+msgid "Message"
+msgstr "Mensaje"
+
+#. module: mail_forward
+#: code:addons/mail_forward/wizards/mail_compose_message.py:0
+#, python-format
+msgid "Re:"
+msgstr ""
+
+#. module: mail_forward
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "Subject"
+msgstr "Asunto"
+
+#. module: mail_forward
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "To"
+msgstr "Para"
diff --git a/mail_forward/i18n/mail_forward.pot b/mail_forward/i18n/mail_forward.pot
new file mode 100644
index 000000000..cf0234fed
--- /dev/null
+++ b/mail_forward/i18n/mail_forward.pot
@@ -0,0 +1,101 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * mail_forward
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 15.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_forward
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "---------- Forwarded message ---------"
+msgstr ""
+
+#. module: mail_forward
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "Date"
+msgstr ""
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_mail_thread
+msgid "Email Thread"
+msgstr ""
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_mail_compose_message
+msgid "Email composition wizard"
+msgstr ""
+
+#. module: mail_forward
+#. openerp-web
+#: code:addons/mail_forward/models/mail_message.py:0
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message"
+msgstr ""
+
+#. module: mail_forward
+#. openerp-web
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message Center"
+msgstr ""
+
+#. module: mail_forward
+#. openerp-web
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message Left"
+msgstr ""
+
+#. module: mail_forward
+#. openerp-web
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message Right"
+msgstr ""
+
+#. module: mail_forward
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "From"
+msgstr ""
+
+#. module: mail_forward
+#: code:addons/mail_forward/wizards/mail_compose_message.py:0
+#, python-format
+msgid "Fwd:"
+msgstr ""
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_mail_message
+msgid "Message"
+msgstr ""
+
+#. module: mail_forward
+#: code:addons/mail_forward/wizards/mail_compose_message.py:0
+#, python-format
+msgid "Re:"
+msgstr ""
+
+#. module: mail_forward
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "Subject"
+msgstr ""
+
+#. module: mail_forward
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "To"
+msgstr ""
diff --git a/mail_forward/models/__init__.py b/mail_forward/models/__init__.py
new file mode 100644
index 000000000..eccc2881b
--- /dev/null
+++ b/mail_forward/models/__init__.py
@@ -0,0 +1,2 @@
+from . import mail_message
+from . import mail_thread
diff --git a/mail_forward/models/mail_message.py b/mail_forward/models/mail_message.py
new file mode 100644
index 000000000..b5bacd621
--- /dev/null
+++ b/mail_forward/models/mail_message.py
@@ -0,0 +1,57 @@
+# Copyright 2024 Tecnativa - Carlos Lopez
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from odoo import _, models
+from odoo.tools import format_datetime
+
+
+class MailMessage(models.Model):
+ _inherit = "mail.message"
+
+ def action_wizard_forward(self):
+ view = self.env.ref("mail_forward.mail_compose_message_forward_form")
+ action = self.env["ir.actions.actions"]._for_xml_id(
+ "mail.action_email_compose_message_wizard"
+ )
+ action["name"] = _("Forward Message")
+ action["view_mode"] = view.type
+ action["views"] = [(view.id, view.type)]
+ action["context"] = {
+ "default_model": self.model,
+ "default_res_id": self.res_id,
+ "default_composition_mode": "comment",
+ "default_body": self._build_message_body_for_forward(),
+ "default_attachment_ids": self.attachment_ids.ids,
+ "default_is_log": False,
+ "default_notify": True,
+ "force_email": True,
+ "message_forwarded_id": self.id,
+ }
+ return action
+
+ def _build_message_body_for_forward(self):
+ partner_emails = [
+ partner.email_formatted
+ for partner in self.partner_ids
+ if partner.email_formatted
+ ]
+ return """
+
+ {str_forwarded_message}
+ {str_from}: {email_from}
+ {str_date}: {date}
+ {str_subject}: {subject}
+ {str_to}: {to}
+
+ {body}
+ """.format(
+ str_forwarded_message=_("---------- Forwarded message ---------"),
+ email_from=self.email_from,
+ date=format_datetime(self.env, self.date),
+ subject=self.subject,
+ to=", ".join(partner_emails),
+ str_date=_("Date"),
+ str_subject=_("Subject"),
+ str_from=_("From"),
+ str_to=_("To"),
+ body=self.body,
+ )
diff --git a/mail_forward/models/mail_thread.py b/mail_forward/models/mail_thread.py
new file mode 100644
index 000000000..ea0bfac3e
--- /dev/null
+++ b/mail_forward/models/mail_thread.py
@@ -0,0 +1,19 @@
+# Copyright 2024 Tecnativa - Carlos Lopez
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from odoo import models
+
+
+class MailThread(models.AbstractModel):
+ _inherit = "mail.thread"
+
+ def _notify_compute_recipients(self, message, msg_vals):
+ recipients_data = super()._notify_compute_recipients(message, msg_vals)
+ # only notify to explicit partners, remove others(followers).
+ if self.env.context.get("message_forwarded_id"):
+ current_partners_ids = message.partner_ids.ids
+ new_recipeints = []
+ for recipeint in recipients_data:
+ if recipeint["id"] in current_partners_ids:
+ new_recipeints.append(recipeint)
+ recipients_data = new_recipeints
+ return recipients_data
diff --git a/mail_forward/readme/CONTRIBUTORS.rst b/mail_forward/readme/CONTRIBUTORS.rst
new file mode 100644
index 000000000..84a60999d
--- /dev/null
+++ b/mail_forward/readme/CONTRIBUTORS.rst
@@ -0,0 +1,2 @@
+* `Tecnativa `_:
+ * Carlos López
diff --git a/mail_forward/readme/DESCRIPTION.rst b/mail_forward/readme/DESCRIPTION.rst
new file mode 100644
index 000000000..10e246711
--- /dev/null
+++ b/mail_forward/readme/DESCRIPTION.rst
@@ -0,0 +1,2 @@
+This module allows users to forward messages from the chatter of any document to other users,
+adding them as followers of the document without notifying the current followers.
diff --git a/mail_forward/readme/USAGE.rst b/mail_forward/readme/USAGE.rst
new file mode 100644
index 000000000..611bacf03
--- /dev/null
+++ b/mail_forward/readme/USAGE.rst
@@ -0,0 +1,8 @@
+To use this module, follow these steps:
+
+* Navigate to the chatter of any document.
+* Hover the mouse over any message in the chatter (excluding internal notes).
+* A Forward icon will appear next to the message.
+* Click the button to display a wizard with the message.
+* Select the users to forward the message to.
+* Click the 'Send Mail' button to send the message to the selected users.
diff --git a/mail_forward/static/description/icon.png b/mail_forward/static/description/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d
GIT binary patch
literal 9455
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
z
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
Xviia!U7SGha1wx#SCgwmn*{w2TRX*I
literal 0
HcmV?d00001
diff --git a/mail_forward/static/description/index.html b/mail_forward/static/description/index.html
new file mode 100644
index 000000000..d236e841f
--- /dev/null
+++ b/mail_forward/static/description/index.html
@@ -0,0 +1,444 @@
+
+
+
+
+
+Mail Forward Message
+
+
+
+
+
Mail Forward Message
+
+
+

+
This module allows users to forward messages from the chatter of any document to other users,
+adding them as followers of the document without notifying the current followers.
+
Table of contents
+
+
+
+
To use this module, follow these steps:
+
+- Navigate to the chatter of any document.
+- Hover the mouse over any message in the chatter (excluding internal notes).
+- A Forward icon will appear next to the message.
+- Click the button to display a wizard with the message.
+- Select the users to forward the message to.
+- Click the ‘Send Mail’ button to send the message to the selected users.
+
+
+
+
+
Bugs are tracked on GitHub 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.
+
Do not contact contributors directly about support or help with technical issues.
+
+
+
+
+
+
+
+
This module is maintained by the OCA.
+
+
+
+
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/social project on GitHub.
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
+
+
+
+
+
diff --git a/mail_forward/static/src/components/forward_message/forward_message.esm.js b/mail_forward/static/src/components/forward_message/forward_message.esm.js
new file mode 100644
index 000000000..654b74a07
--- /dev/null
+++ b/mail_forward/static/src/components/forward_message/forward_message.esm.js
@@ -0,0 +1,44 @@
+/** @odoo-module **/
+/* Copyright 2024 Tecnativa - Carlos Lopez
+ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+*/
+import {registerMessagingComponent} from "@mail/utils/messaging_component";
+const {Component} = owl;
+
+export class ForwardMessage extends Component {
+ async onClickForwardMessage() {
+ const composer = this.props.message.originThread.composer;
+ const action = await this.env.services.rpc({
+ model: "mail.message",
+ method: "action_wizard_forward",
+ args: [[this.props.message.id]],
+ });
+ this.env.bus.trigger("do-action", {
+ action: action,
+ options: {
+ additional_context: {
+ active_id: this.props.message.id,
+ active_ids: [this.props.message.id],
+ active_model: "mail.message",
+ },
+ on_close: () => {
+ if (composer.exists()) {
+ composer._reset();
+ if (composer.activeThread) {
+ composer.activeThread.loadNewMessages();
+ composer.activeThread.refreshFollowers();
+ composer.activeThread.fetchAndUpdateSuggestedRecipients();
+ }
+ }
+ },
+ },
+ });
+ }
+}
+
+ForwardMessage.template = "mail_forward.ForwardMessage";
+ForwardMessage.props = {
+ message: Object,
+};
+
+registerMessagingComponent(ForwardMessage);
diff --git a/mail_forward/static/src/components/forward_message/forward_message.xml b/mail_forward/static/src/components/forward_message/forward_message.xml
new file mode 100644
index 000000000..0da6d778c
--- /dev/null
+++ b/mail_forward/static/src/components/forward_message/forward_message.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/mail_forward/static/src/components/message_action_list/message_action_list.xml b/mail_forward/static/src/components/message_action_list/message_action_list.xml
new file mode 100644
index 000000000..4f13fa8fb
--- /dev/null
+++ b/mail_forward/static/src/components/message_action_list/message_action_list.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
diff --git a/mail_forward/static/tests/tours/mail_forward.esm.js b/mail_forward/static/tests/tours/mail_forward.esm.js
new file mode 100644
index 000000000..363e1cbe2
--- /dev/null
+++ b/mail_forward/static/tests/tours/mail_forward.esm.js
@@ -0,0 +1,116 @@
+/** @odoo-module */
+
+import tour from "web_tour.tour";
+const contact_steps = [
+ ...tour.stepUtils.goToAppSteps("contacts.menu_contacts", "Go to the Contacts."),
+ {
+ content: "Search Contact",
+ trigger: ".o_searchview_input",
+ run: "text Test",
+ },
+ {
+ trigger: ".o_menu_item",
+ content: "Validate search",
+ run: "click",
+ },
+ {
+ content: "Switch to list view",
+ trigger: ".o_list",
+ run: "click",
+ },
+ {
+ content: "Open contact",
+ trigger: ".o_list_table td[name='display_name']:contains('Test')",
+ },
+];
+tour.register(
+ "mail_forward.mail_forward_tour",
+ {
+ test: true,
+ url: "/web",
+ },
+ [
+ ...contact_steps,
+ {
+ content: "Open Chat",
+ trigger: ".o_ChatterTopbar_buttonSendMessage",
+ run: "click",
+ },
+ {
+ content: "Write a message",
+ trigger: ".o_ComposerTextInput_textarea",
+ run: "text Hello World",
+ },
+ {
+ content: "Post a message",
+ trigger: ".o_Composer_buttonSend",
+ },
+ {
+ content: "Hover a message",
+ trigger: "div.o_Message.o-discussion",
+ run: "click",
+ },
+ {
+ content: "Forward a message",
+ trigger: ".o_MessageActionList_actionForward",
+ run: "click",
+ },
+ {
+ content: "Select a Forward",
+ trigger: ".o_field_widget[name=partner_ids] input",
+ extra_trigger: ".modal-dialog",
+ run: "text Forward",
+ },
+ {
+ content: "Valid Forward",
+ trigger: ".ui-menu-item a:contains(Forward)",
+ run: "click",
+ in_modal: false,
+ },
+ {
+ content: "Send mail",
+ trigger: "button[name=action_send_mail]",
+ run: "click",
+ },
+ {
+ content: "Check Mail Forward",
+ trigger:
+ ".o_Message_prettyBody:contains(---------- Forwarded message ---------)",
+ },
+ ]
+);
+
+tour.register(
+ "mail_forward.mail_note_not_forward_tour",
+ {
+ test: true,
+ url: "/web",
+ },
+ [
+ ...contact_steps,
+ {
+ content: "Open Chat",
+ trigger: ".o_ChatterTopbar_buttonLogNote",
+ run: "click",
+ },
+ {
+ content: "Write a note",
+ trigger: ".o_ComposerTextInput_textarea",
+ run: "text This is a note",
+ },
+ {
+ content: "Post a note",
+ trigger: ".o_Composer_buttonSend",
+ },
+ {
+ content: "Hover a note",
+ trigger: "div.o_Message.o-not-discussion",
+ run: "click",
+ },
+ {
+ content: "Verify that the Forward button does not exist.",
+ trigger:
+ "div.o_Message.o-not-discussion:not(.o_MessageActionList_actionForward)",
+ },
+ ]
+);
diff --git a/mail_forward/tests/__init__.py b/mail_forward/tests/__init__.py
new file mode 100644
index 000000000..d83263f3c
--- /dev/null
+++ b/mail_forward/tests/__init__.py
@@ -0,0 +1 @@
+from . import test_mail_forward
diff --git a/mail_forward/tests/test_mail_forward.py b/mail_forward/tests/test_mail_forward.py
new file mode 100644
index 000000000..b6e632b35
--- /dev/null
+++ b/mail_forward/tests/test_mail_forward.py
@@ -0,0 +1,77 @@
+# Copyright 2024 Tecnativa - Carlos Lopez
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+
+from odoo.tests import Form, RecordCapturer, tagged
+from odoo.tests.common import HttpCase
+
+from odoo.addons.mail.tests.test_mail_composer import TestMailComposer
+
+
+@tagged("post_install", "-at_install")
+class TestMailForward(TestMailComposer, HttpCase):
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+ cls.partner_follower1 = cls.env["res.partner"].create(
+ {"name": "Follower1", "email": "follower1@example.com"}
+ )
+ cls.partner_follower2 = cls.env["res.partner"].create(
+ {"name": "Follower2", "email": "follower2@example.com"}
+ )
+ cls.partner_forward = cls.env["res.partner"].create(
+ {"name": "Forward", "email": "forward@example.com"}
+ )
+
+ def test_01_mail_forward(self):
+ """
+ Send an email to followers
+ and forward it to another partner.
+ """
+ ctx = {
+ "default_model": self.test_record._name,
+ "default_res_id": self.test_record.id,
+ }
+ composer_form = Form(self.env["mail.compose.message"].with_context(**ctx))
+ composer_form.body = "Hello
"
+ composer_form.partner_ids.add(self.partner_follower1)
+ composer_form.partner_ids.add(self.partner_follower2)
+ composer = composer_form.save()
+ with self.mock_mail_gateway():
+ composer._action_send_mail()
+ # Verify recipients of mail.message
+ message = self.test_record.message_ids[0]
+ self.assertEqual(len(message.partner_ids), 2)
+ self.assertIn(self.partner_follower1, message.partner_ids)
+ self.assertIn(self.partner_follower2, message.partner_ids)
+ self.assertNotIn(self.partner_forward, message.partner_ids)
+ self.assertNotIn("---------- Forwarded message ---------", message.body)
+ # Forward the email
+ # only the partner_forward should receive the email
+ action_forward = message.action_wizard_forward()
+ Message = self.env["mail.compose.message"].with_context(
+ **action_forward["context"]
+ )
+ composer_form = Form(Message, view=action_forward["views"][0][0])
+ composer_form.partner_ids.add(self.partner_forward)
+ composer = composer_form.save()
+ message_domain = [
+ ("model", "=", self.test_record._name),
+ ("res_id", "=", self.test_record.id),
+ ]
+ with RecordCapturer(self.env["mail.message"], message_domain) as capture:
+ with self.mock_mail_gateway():
+ composer._action_send_mail()
+ # Verify recipients of mail.message
+ forward_message = capture.records
+ self.assertEqual(len(forward_message.partner_ids), 1)
+ self.assertNotIn(self.partner_follower1, forward_message.partner_ids)
+ self.assertIn(self.partner_forward, forward_message.partner_ids)
+ self.assertIn("---------- Forwarded message ---------", forward_message.body)
+
+ def test_02_mail_forward_tour(self):
+ self.start_tour("/web", "mail_forward.mail_forward_tour", login="admin")
+
+ def test_03_mail_note_not_forward_tour(self):
+ self.start_tour(
+ "/web", "mail_forward.mail_note_not_forward_tour", login="admin"
+ )
diff --git a/mail_forward/wizards/__init__.py b/mail_forward/wizards/__init__.py
new file mode 100644
index 000000000..b528d997d
--- /dev/null
+++ b/mail_forward/wizards/__init__.py
@@ -0,0 +1 @@
+from . import mail_compose_message
diff --git a/mail_forward/wizards/mail_compose_message.py b/mail_forward/wizards/mail_compose_message.py
new file mode 100644
index 000000000..19ccfcb89
--- /dev/null
+++ b/mail_forward/wizards/mail_compose_message.py
@@ -0,0 +1,39 @@
+# Copyright 2024 Tecnativa - Carlos Lopez
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from odoo import Command, _, api, models
+
+
+class MailComposeMessage(models.TransientModel):
+ _inherit = "mail.compose.message"
+
+ @api.model
+ def get_record_data(self, values):
+ result = super().get_record_data(values)
+ re_prefix = _("Re:")
+ fwd_prefix = _("Fwd:")
+ if self.env.context.get("message_forwarded_id"):
+ # remove 'Re: ' prefixes and add 'Fwd:' prefix to the subject
+ subject = result.get("subject")
+ if subject and subject.startswith(re_prefix):
+ subject = "%s %s" % (fwd_prefix, subject[4:])
+ result["subject"] = subject
+ return result
+
+ def _action_send_mail(self, auto_commit=False):
+ # duplicate attachments from original message
+ message_forwarded_id = self.env.context.get("message_forwarded_id")
+ if message_forwarded_id:
+ message_forwarded = self.env["mail.message"].browse(message_forwarded_id)
+ for wizard in self:
+ new_attachment_ids = []
+ for attachment in wizard.attachment_ids:
+ if attachment in message_forwarded.attachment_ids:
+ new_attachment = attachment.copy(
+ {"res_model": "mail.compose.message", "res_id": wizard.id}
+ )
+ new_attachment_ids.append(new_attachment.id)
+ else:
+ new_attachment_ids.append(attachment.id)
+ new_attachment_ids.reverse()
+ wizard.write({"attachment_ids": [Command.set(new_attachment_ids)]})
+ return super()._action_send_mail(auto_commit=auto_commit)
diff --git a/mail_forward/wizards/mail_compose_message_view.xml b/mail_forward/wizards/mail_compose_message_view.xml
new file mode 100644
index 000000000..bda46bed9
--- /dev/null
+++ b/mail_forward/wizards/mail_compose_message_view.xml
@@ -0,0 +1,27 @@
+
+
+
+ mail.compose.message.form.forward
+ mail.compose.message
+ primary
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
From 4e6f6d6660bc2c6acf5310659da3416527bb8db1 Mon Sep 17 00:00:00 2001
From: Carlos Lopez
Date: Fri, 4 Oct 2024 08:23:30 -0500
Subject: [PATCH 02/44] [FIX] mail_forward: prevent errors during the test tour
when web_responsive is installed.
---
mail_forward/README.rst | 2 +-
mail_forward/__manifest__.py | 2 +-
mail_forward/static/description/index.html | 2 +-
mail_forward/static/tests/tours/mail_forward.esm.js | 7 ++++++-
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/mail_forward/README.rst b/mail_forward/README.rst
index 99c7b20a1..0988d07dc 100644
--- a/mail_forward/README.rst
+++ b/mail_forward/README.rst
@@ -7,7 +7,7 @@ Mail Forward Message
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:ce6348512860de33703c2523bb1131aa2bb23a10374db4fb6f66383a7933134f
+ !! source digest: sha256:f9107727227b807b8c178598ae0b5477c4692574ca4f87786cd4197027e23268
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
diff --git a/mail_forward/__manifest__.py b/mail_forward/__manifest__.py
index d693cfb9c..6134ef4a6 100644
--- a/mail_forward/__manifest__.py
+++ b/mail_forward/__manifest__.py
@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Mail Forward Message",
- "version": "15.0.1.0.0",
+ "version": "15.0.1.0.1",
"summary": "Forward messages from the chatter of any document to other users.",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social",
diff --git a/mail_forward/static/description/index.html b/mail_forward/static/description/index.html
index d236e841f..ad543adef 100644
--- a/mail_forward/static/description/index.html
+++ b/mail_forward/static/description/index.html
@@ -367,7 +367,7 @@ Mail Forward Message
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:ce6348512860de33703c2523bb1131aa2bb23a10374db4fb6f66383a7933134f
+!! source digest: sha256:f9107727227b807b8c178598ae0b5477c4692574ca4f87786cd4197027e23268
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

This module allows users to forward messages from the chatter of any document to other users,
diff --git a/mail_forward/static/tests/tours/mail_forward.esm.js b/mail_forward/static/tests/tours/mail_forward.esm.js
index 363e1cbe2..4845900a3 100644
--- a/mail_forward/static/tests/tours/mail_forward.esm.js
+++ b/mail_forward/static/tests/tours/mail_forward.esm.js
@@ -2,7 +2,12 @@
import tour from "web_tour.tour";
const contact_steps = [
- ...tour.stepUtils.goToAppSteps("contacts.menu_contacts", "Go to the Contacts."),
+ {
+ trigger: ".o_navbar_apps_menu button",
+ },
+ {
+ trigger: '.o_app[data-menu-xmlid="contacts.menu_contacts"]',
+ },
{
content: "Search Contact",
trigger: ".o_searchview_input",
From 0f6a0e1818fdafb4575f4d093635946ac5137c5e Mon Sep 17 00:00:00 2001
From: Carlos Lopez
Date: Tue, 7 Jan 2025 11:26:12 -0500
Subject: [PATCH 03/44] [IMP] mail_forward: pre-commit auto fixes
---
mail_forward/README.rst | 40 ++++++++++++----------
mail_forward/pyproject.toml | 3 ++
mail_forward/readme/CONTRIBUTORS.md | 2 ++
mail_forward/readme/CONTRIBUTORS.rst | 2 --
mail_forward/readme/DESCRIPTION.md | 3 ++
mail_forward/readme/DESCRIPTION.rst | 2 --
mail_forward/readme/USAGE.md | 10 ++++++
mail_forward/readme/USAGE.rst | 8 -----
mail_forward/static/description/index.html | 23 ++++++-------
9 files changed, 51 insertions(+), 42 deletions(-)
create mode 100644 mail_forward/pyproject.toml
create mode 100644 mail_forward/readme/CONTRIBUTORS.md
delete mode 100644 mail_forward/readme/CONTRIBUTORS.rst
create mode 100644 mail_forward/readme/DESCRIPTION.md
delete mode 100644 mail_forward/readme/DESCRIPTION.rst
create mode 100644 mail_forward/readme/USAGE.md
delete mode 100644 mail_forward/readme/USAGE.rst
diff --git a/mail_forward/README.rst b/mail_forward/README.rst
index 0988d07dc..be5a83976 100644
--- a/mail_forward/README.rst
+++ b/mail_forward/README.rst
@@ -17,19 +17,20 @@ Mail Forward Message
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github
- :target: https://github.com/OCA/social/tree/15.0/mail_forward
+ :target: https://github.com/OCA/social/tree/17.0/mail_forward
:alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/social-15-0/social-15-0-mail_forward
+ :target: https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_forward
: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/social&target_branch=15.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=17.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
-This module allows users to forward messages from the chatter of any document to other users,
-adding them as followers of the document without notifying the current followers.
+This module allows users to forward messages from the chatter of any
+document to other users, adding them as followers of the document
+without notifying the current followers.
**Table of contents**
@@ -41,12 +42,14 @@ Usage
To use this module, follow these steps:
-* Navigate to the chatter of any document.
-* Hover the mouse over any message in the chatter (excluding internal notes).
-* A Forward icon will appear next to the message.
-* Click the button to display a wizard with the message.
-* Select the users to forward the message to.
-* Click the 'Send Mail' button to send the message to the selected users.
+- Navigate to the chatter of any document.
+- Hover the mouse over any message in the chatter (excluding internal
+ notes).
+- A Forward icon will appear next to the message.
+- Click the button to display a wizard with the message.
+- Select the users to forward the message to.
+- Click the 'Send Mail' button to send the message to the selected
+ users.
Bug Tracker
===========
@@ -54,7 +57,7 @@ Bug Tracker
Bugs are tracked on `GitHub 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -62,18 +65,19 @@ Credits
=======
Authors
-~~~~~~~
+-------
* Tecnativa
Contributors
-~~~~~~~~~~~~
+------------
-* `Tecnativa `_:
- * Carlos López
+- `Tecnativa `__:
+
+ - Carlos López
Maintainers
-~~~~~~~~~~~
+-----------
This module is maintained by the OCA.
@@ -85,6 +89,6 @@ 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/social `_ project on GitHub.
+This module is part of the `OCA/social `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/mail_forward/pyproject.toml b/mail_forward/pyproject.toml
new file mode 100644
index 000000000..4231d0ccc
--- /dev/null
+++ b/mail_forward/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["whool"]
+build-backend = "whool.buildapi"
diff --git a/mail_forward/readme/CONTRIBUTORS.md b/mail_forward/readme/CONTRIBUTORS.md
new file mode 100644
index 000000000..e91f80b2e
--- /dev/null
+++ b/mail_forward/readme/CONTRIBUTORS.md
@@ -0,0 +1,2 @@
+- [Tecnativa](https://www.tecnativa.com):
+ - Carlos López
diff --git a/mail_forward/readme/CONTRIBUTORS.rst b/mail_forward/readme/CONTRIBUTORS.rst
deleted file mode 100644
index 84a60999d..000000000
--- a/mail_forward/readme/CONTRIBUTORS.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-* `Tecnativa `_:
- * Carlos López
diff --git a/mail_forward/readme/DESCRIPTION.md b/mail_forward/readme/DESCRIPTION.md
new file mode 100644
index 000000000..fe56c5546
--- /dev/null
+++ b/mail_forward/readme/DESCRIPTION.md
@@ -0,0 +1,3 @@
+This module allows users to forward messages from the chatter of any
+document to other users, adding them as followers of the document
+without notifying the current followers.
diff --git a/mail_forward/readme/DESCRIPTION.rst b/mail_forward/readme/DESCRIPTION.rst
deleted file mode 100644
index 10e246711..000000000
--- a/mail_forward/readme/DESCRIPTION.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-This module allows users to forward messages from the chatter of any document to other users,
-adding them as followers of the document without notifying the current followers.
diff --git a/mail_forward/readme/USAGE.md b/mail_forward/readme/USAGE.md
new file mode 100644
index 000000000..0befa7862
--- /dev/null
+++ b/mail_forward/readme/USAGE.md
@@ -0,0 +1,10 @@
+To use this module, follow these steps:
+
+- Navigate to the chatter of any document.
+- Hover the mouse over any message in the chatter (excluding internal
+ notes).
+- A Forward icon will appear next to the message.
+- Click the button to display a wizard with the message.
+- Select the users to forward the message to.
+- Click the 'Send Mail' button to send the message to the selected
+ users.
diff --git a/mail_forward/readme/USAGE.rst b/mail_forward/readme/USAGE.rst
deleted file mode 100644
index 611bacf03..000000000
--- a/mail_forward/readme/USAGE.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-To use this module, follow these steps:
-
-* Navigate to the chatter of any document.
-* Hover the mouse over any message in the chatter (excluding internal notes).
-* A Forward icon will appear next to the message.
-* Click the button to display a wizard with the message.
-* Select the users to forward the message to.
-* Click the 'Send Mail' button to send the message to the selected users.
diff --git a/mail_forward/static/description/index.html b/mail_forward/static/description/index.html
index ad543adef..d97a61f76 100644
--- a/mail_forward/static/description/index.html
+++ b/mail_forward/static/description/index.html
@@ -369,9 +369,10 @@ Mail Forward Message
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f9107727227b807b8c178598ae0b5477c4692574ca4f87786cd4197027e23268
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

-This module allows users to forward messages from the chatter of any document to other users,
-adding them as followers of the document without notifying the current followers.
+

+This module allows users to forward messages from the chatter of any
+document to other users, adding them as followers of the document
+without notifying the current followers.
Table of contents
@@ -390,11 +391,13 @@
To use this module, follow these steps:
- Navigate to the chatter of any document.
-- Hover the mouse over any message in the chatter (excluding internal notes).
+- Hover the mouse over any message in the chatter (excluding internal
+notes).
- A Forward icon will appear next to the message.
- Click the button to display a wizard with the message.
- Select the users to forward the message to.
-- Click the ‘Send Mail’ button to send the message to the selected users.
+- Click the ‘Send Mail’ button to send the message to the selected
+users.
@@ -402,7 +405,7 @@
Bugs are tracked on GitHub 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.
+
feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -416,13 +419,9 @@
@@ -435,7 +434,7 @@
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/social project on GitHub.
+
This module is part of the OCA/social project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
From 968cc1b6f2980d33b849241057d1f04127b04464 Mon Sep 17 00:00:00 2001
From: Carlos Lopez
Date: Wed, 22 Jan 2025 10:53:11 -0500
Subject: [PATCH 04/44] [MIG] mail_forward: Migration to version 17.0
---
mail_forward/__manifest__.py | 8 +-
mail_forward/models/mail_message.py | 2 +-
mail_forward/models/mail_thread.py | 4 +-
.../forward_message/forward_message.esm.js | 46 +++++------
.../forward_message/forward_message.xml | 48 ++++++------
.../message_action_list.xml | 12 ---
.../src/core/common/message_actions.esm.js | 17 +++++
.../static/tests/tours/mail_forward.esm.js | 76 +++++--------------
mail_forward/tests/test_mail_forward.py | 9 ++-
mail_forward/wizards/mail_compose_message.py | 2 +-
.../wizards/mail_compose_message_view.xml | 2 +-
11 files changed, 99 insertions(+), 127 deletions(-)
delete mode 100644 mail_forward/static/src/components/message_action_list/message_action_list.xml
create mode 100644 mail_forward/static/src/core/common/message_actions.esm.js
diff --git a/mail_forward/__manifest__.py b/mail_forward/__manifest__.py
index 6134ef4a6..7eb972af2 100644
--- a/mail_forward/__manifest__.py
+++ b/mail_forward/__manifest__.py
@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Mail Forward Message",
- "version": "15.0.1.0.1",
+ "version": "17.0.1.0.0",
"summary": "Forward messages from the chatter of any document to other users.",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social",
@@ -12,10 +12,8 @@
],
"assets": {
"web.assets_backend": [
- "mail_forward/static/src/components/**/*.esm.js",
- ],
- "web.assets_qweb": [
- "mail_forward/static/src/components/*/*.xml",
+ "mail_forward/static/src/**/*.esm.js",
+ "mail_forward/static/src/**/*.xml",
],
"web.assets_tests": [
"mail_forward/static/tests/tours/**/*",
diff --git a/mail_forward/models/mail_message.py b/mail_forward/models/mail_message.py
index b5bacd621..57a68cfbe 100644
--- a/mail_forward/models/mail_message.py
+++ b/mail_forward/models/mail_message.py
@@ -17,7 +17,7 @@ def action_wizard_forward(self):
action["views"] = [(view.id, view.type)]
action["context"] = {
"default_model": self.model,
- "default_res_id": self.res_id,
+ "default_res_ids": [self.res_id],
"default_composition_mode": "comment",
"default_body": self._build_message_body_for_forward(),
"default_attachment_ids": self.attachment_ids.ids,
diff --git a/mail_forward/models/mail_thread.py b/mail_forward/models/mail_thread.py
index ea0bfac3e..babb29db5 100644
--- a/mail_forward/models/mail_thread.py
+++ b/mail_forward/models/mail_thread.py
@@ -6,8 +6,8 @@
class MailThread(models.AbstractModel):
_inherit = "mail.thread"
- def _notify_compute_recipients(self, message, msg_vals):
- recipients_data = super()._notify_compute_recipients(message, msg_vals)
+ def _notify_get_recipients(self, message, msg_vals, **kwargs):
+ recipients_data = super()._notify_get_recipients(message, msg_vals, **kwargs)
# only notify to explicit partners, remove others(followers).
if self.env.context.get("message_forwarded_id"):
current_partners_ids = message.partner_ids.ids
diff --git a/mail_forward/static/src/components/forward_message/forward_message.esm.js b/mail_forward/static/src/components/forward_message/forward_message.esm.js
index 654b74a07..0fc7c0ca2 100644
--- a/mail_forward/static/src/components/forward_message/forward_message.esm.js
+++ b/mail_forward/static/src/components/forward_message/forward_message.esm.js
@@ -2,35 +2,31 @@
/* Copyright 2024 Tecnativa - Carlos Lopez
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
*/
-import {registerMessagingComponent} from "@mail/utils/messaging_component";
const {Component} = owl;
+import {useService} from "@web/core/utils/hooks";
export class ForwardMessage extends Component {
+ setup() {
+ super.setup();
+ this.threadService = useService("mail.thread");
+ }
async onClickForwardMessage() {
const composer = this.props.message.originThread.composer;
- const action = await this.env.services.rpc({
- model: "mail.message",
- method: "action_wizard_forward",
- args: [[this.props.message.id]],
- });
- this.env.bus.trigger("do-action", {
- action: action,
- options: {
- additional_context: {
- active_id: this.props.message.id,
- active_ids: [this.props.message.id],
- active_model: "mail.message",
- },
- on_close: () => {
- if (composer.exists()) {
- composer._reset();
- if (composer.activeThread) {
- composer.activeThread.loadNewMessages();
- composer.activeThread.refreshFollowers();
- composer.activeThread.fetchAndUpdateSuggestedRecipients();
- }
- }
- },
+ const action = await this.env.services.orm.call(
+ "mail.message",
+ "action_wizard_forward",
+ [[this.props.message.id]]
+ );
+ this.env.services.action.doAction(action, {
+ additionalContext: {
+ active_id: this.props.message.id,
+ active_ids: [this.props.message.id],
+ active_model: "mail.message",
+ },
+ onClose: () => {
+ if (composer.thread) {
+ this.threadService.fetchNewMessages(composer.thread);
+ }
},
});
}
@@ -40,5 +36,3 @@ ForwardMessage.template = "mail_forward.ForwardMessage";
ForwardMessage.props = {
message: Object,
};
-
-registerMessagingComponent(ForwardMessage);
diff --git a/mail_forward/static/src/components/forward_message/forward_message.xml b/mail_forward/static/src/components/forward_message/forward_message.xml
index 0da6d778c..070664668 100644
--- a/mail_forward/static/src/components/forward_message/forward_message.xml
+++ b/mail_forward/static/src/components/forward_message/forward_message.xml
@@ -1,32 +1,34 @@
-
-
+
-
-
-
-
+
+
+
+
+
+ Forward
+
diff --git a/mail_forward/static/src/components/message_action_list/message_action_list.xml b/mail_forward/static/src/components/message_action_list/message_action_list.xml
deleted file mode 100644
index 4f13fa8fb..000000000
--- a/mail_forward/static/src/components/message_action_list/message_action_list.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/mail_forward/static/src/core/common/message_actions.esm.js b/mail_forward/static/src/core/common/message_actions.esm.js
new file mode 100644
index 000000000..37b7fb019
--- /dev/null
+++ b/mail_forward/static/src/core/common/message_actions.esm.js
@@ -0,0 +1,17 @@
+/* @odoo-module */
+/* Copyright 2024 Tecnativa - Carlos Lopez
+ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+*/
+
+import {_t} from "@web/core/l10n/translation";
+import {ForwardMessage} from "../../components/forward_message/forward_message.esm";
+import {messageActionsRegistry} from "@mail/core/common/message_actions";
+
+messageActionsRegistry.add("forward", {
+ callComponent: ForwardMessage,
+ props: (component) => ({message: component.props.message}),
+ condition: (component) =>
+ component.props.message.is_discussion && !component.props.message.is_note,
+ sequence: 15,
+ title: _t("Forward"),
+});
diff --git a/mail_forward/static/tests/tours/mail_forward.esm.js b/mail_forward/static/tests/tours/mail_forward.esm.js
index 4845900a3..3f4b720fc 100644
--- a/mail_forward/static/tests/tours/mail_forward.esm.js
+++ b/mail_forward/static/tests/tours/mail_forward.esm.js
@@ -1,6 +1,7 @@
/** @odoo-module */
-import tour from "web_tour.tour";
+import {registry} from "@web/core/registry";
+
const contact_steps = [
{
trigger: ".o_navbar_apps_menu button",
@@ -11,7 +12,7 @@ const contact_steps = [
{
content: "Search Contact",
trigger: ".o_searchview_input",
- run: "text Test",
+ run: "text Test Forward",
},
{
trigger: ".o_menu_item",
@@ -25,39 +26,22 @@ const contact_steps = [
},
{
content: "Open contact",
- trigger: ".o_list_table td[name='display_name']:contains('Test')",
+ trigger: ".o_list_table td[name='complete_name']:contains('Test Forward')",
},
];
-tour.register(
- "mail_forward.mail_forward_tour",
- {
- test: true,
- url: "/web",
- },
- [
+registry.category("web_tour.tours").add("mail_forward.mail_forward_tour", {
+ test: true,
+ url: "/web",
+ steps: () => [
...contact_steps,
- {
- content: "Open Chat",
- trigger: ".o_ChatterTopbar_buttonSendMessage",
- run: "click",
- },
- {
- content: "Write a message",
- trigger: ".o_ComposerTextInput_textarea",
- run: "text Hello World",
- },
- {
- content: "Post a message",
- trigger: ".o_Composer_buttonSend",
- },
{
content: "Hover a message",
- trigger: "div.o_Message.o-discussion",
+ trigger: "div.o-mail-Message[aria-label='Message'] button.dropdown-toggle",
run: "click",
},
{
content: "Forward a message",
- trigger: ".o_MessageActionList_actionForward",
+ trigger: ".mail_forward_message",
run: "click",
},
{
@@ -80,42 +64,24 @@ tour.register(
{
content: "Check Mail Forward",
trigger:
- ".o_Message_prettyBody:contains(---------- Forwarded message ---------)",
+ "div.o-mail-Message[aria-label='Message']:contains(---------- Forwarded message ---------)",
},
- ]
-);
+ ],
+});
-tour.register(
- "mail_forward.mail_note_not_forward_tour",
- {
- test: true,
- url: "/web",
- },
- [
+registry.category("web_tour.tours").add("mail_forward.mail_note_not_forward_tour", {
+ test: true,
+ url: "/web",
+ steps: () => [
...contact_steps,
- {
- content: "Open Chat",
- trigger: ".o_ChatterTopbar_buttonLogNote",
- run: "click",
- },
- {
- content: "Write a note",
- trigger: ".o_ComposerTextInput_textarea",
- run: "text This is a note",
- },
- {
- content: "Post a note",
- trigger: ".o_Composer_buttonSend",
- },
{
content: "Hover a note",
- trigger: "div.o_Message.o-not-discussion",
+ trigger: "div.o-mail-Message[aria-label='Note']",
run: "click",
},
{
content: "Verify that the Forward button does not exist.",
- trigger:
- "div.o_Message.o-not-discussion:not(.o_MessageActionList_actionForward)",
+ trigger: "div.o-mail-Message[aria-label='Note']:not(.mail_forward_message)",
},
- ]
-);
+ ],
+});
diff --git a/mail_forward/tests/test_mail_forward.py b/mail_forward/tests/test_mail_forward.py
index b6e632b35..88f311bf4 100644
--- a/mail_forward/tests/test_mail_forward.py
+++ b/mail_forward/tests/test_mail_forward.py
@@ -12,6 +12,7 @@ class TestMailForward(TestMailComposer, HttpCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
+ cls.test_record.write({"name": "Test Forward", "email": "test@example.com"})
cls.partner_follower1 = cls.env["res.partner"].create(
{"name": "Follower1", "email": "follower1@example.com"}
)
@@ -29,7 +30,7 @@ def test_01_mail_forward(self):
"""
ctx = {
"default_model": self.test_record._name,
- "default_res_id": self.test_record.id,
+ "default_res_ids": [self.test_record.id],
}
composer_form = Form(self.env["mail.compose.message"].with_context(**ctx))
composer_form.body = "Hello
"
@@ -69,9 +70,15 @@ def test_01_mail_forward(self):
self.assertIn("---------- Forwarded message ---------", forward_message.body)
def test_02_mail_forward_tour(self):
+ self.test_record.message_post(
+ body="Hello World", message_type="comment", subtype_xmlid="mail.mt_comment"
+ )
self.start_tour("/web", "mail_forward.mail_forward_tour", login="admin")
def test_03_mail_note_not_forward_tour(self):
+ self.test_record.message_post(
+ body="This is a note", message_type="comment", subtype_xmlid="mail.mt_note"
+ )
self.start_tour(
"/web", "mail_forward.mail_note_not_forward_tour", login="admin"
)
diff --git a/mail_forward/wizards/mail_compose_message.py b/mail_forward/wizards/mail_compose_message.py
index 19ccfcb89..cb36069e2 100644
--- a/mail_forward/wizards/mail_compose_message.py
+++ b/mail_forward/wizards/mail_compose_message.py
@@ -15,7 +15,7 @@ def get_record_data(self, values):
# remove 'Re: ' prefixes and add 'Fwd:' prefix to the subject
subject = result.get("subject")
if subject and subject.startswith(re_prefix):
- subject = "%s %s" % (fwd_prefix, subject[4:])
+ subject = f"{fwd_prefix} {subject[4:]}"
result["subject"] = subject
return result
diff --git a/mail_forward/wizards/mail_compose_message_view.xml b/mail_forward/wizards/mail_compose_message_view.xml
index bda46bed9..1327be8d2 100644
--- a/mail_forward/wizards/mail_compose_message_view.xml
+++ b/mail_forward/wizards/mail_compose_message_view.xml
@@ -17,7 +17,7 @@
1
1
From d1c1b771642b559b290df785642d3ff8c6f40281 Mon Sep 17 00:00:00 2001
From: Carlos Lopez
Date: Wed, 22 Jan 2025 10:54:38 -0500
Subject: [PATCH 05/44] [FIX] mail_forward: Render message actions correctly
with callComponent Currently, Odoo only renders the callComponent for quick
actions (2 or 3 actions). However, the remaining actions, rendered as
DropdownItem, do not invoke the callComponent. This commit ensures that the
rendering is consistent in both cases.
Complementary to: #131426
TODO: This code should be removed once the issue is fixed in the Odoo core.
https://github.com/odoo/odoo/pull/194643
---
mail_forward/README.rst | 2 +-
mail_forward/i18n/mail_forward.pot | 26 +++++++++++++---
mail_forward/static/description/index.html | 2 +-
.../static/src/core/common/message.xml | 31 +++++++++++++++++++
4 files changed, 54 insertions(+), 7 deletions(-)
create mode 100644 mail_forward/static/src/core/common/message.xml
diff --git a/mail_forward/README.rst b/mail_forward/README.rst
index be5a83976..330d938ad 100644
--- a/mail_forward/README.rst
+++ b/mail_forward/README.rst
@@ -7,7 +7,7 @@ Mail Forward Message
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:f9107727227b807b8c178598ae0b5477c4692574ca4f87786cd4197027e23268
+ !! source digest: sha256:aaa71d008cc1c6a1fe737e7a99a760431d3442126800ceb78f5c6a09f0b01727
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
diff --git a/mail_forward/i18n/mail_forward.pot b/mail_forward/i18n/mail_forward.pot
index cf0234fed..17da3d1ee 100644
--- a/mail_forward/i18n/mail_forward.pot
+++ b/mail_forward/i18n/mail_forward.pot
@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 15.0\n"
+"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -14,12 +14,14 @@ msgstr ""
"Plural-Forms: \n"
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#, python-format
msgid "---------- Forwarded message ---------"
msgstr ""
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#, python-format
msgid "Date"
@@ -36,7 +38,16 @@ msgid "Email composition wizard"
msgstr ""
#. module: mail_forward
-#. openerp-web
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#: code:addons/mail_forward/static/src/core/common/message_actions.esm.js:0
+#, python-format
+msgid "Forward"
+msgstr ""
+
+#. module: mail_forward
+#. odoo-javascript
+#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
@@ -45,33 +56,35 @@ msgid "Forward Message"
msgstr ""
#. module: mail_forward
-#. openerp-web
+#. odoo-javascript
#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
#, python-format
msgid "Forward Message Center"
msgstr ""
#. module: mail_forward
-#. openerp-web
+#. odoo-javascript
#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
#, python-format
msgid "Forward Message Left"
msgstr ""
#. module: mail_forward
-#. openerp-web
+#. odoo-javascript
#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
#, python-format
msgid "Forward Message Right"
msgstr ""
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#, python-format
msgid "From"
msgstr ""
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/wizards/mail_compose_message.py:0
#, python-format
msgid "Fwd:"
@@ -83,18 +96,21 @@ msgid "Message"
msgstr ""
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/wizards/mail_compose_message.py:0
#, python-format
msgid "Re:"
msgstr ""
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#, python-format
msgid "Subject"
msgstr ""
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#, python-format
msgid "To"
diff --git a/mail_forward/static/description/index.html b/mail_forward/static/description/index.html
index d97a61f76..abaa040f4 100644
--- a/mail_forward/static/description/index.html
+++ b/mail_forward/static/description/index.html
@@ -367,7 +367,7 @@ Mail Forward Message
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:f9107727227b807b8c178598ae0b5477c4692574ca4f87786cd4197027e23268
+!! source digest: sha256:aaa71d008cc1c6a1fe737e7a99a760431d3442126800ceb78f5c6a09f0b01727
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

This module allows users to forward messages from the chatter of any
diff --git a/mail_forward/static/src/core/common/message.xml b/mail_forward/static/src/core/common/message.xml
new file mode 100644
index 000000000..5c43a72c6
--- /dev/null
+++ b/mail_forward/static/src/core/common/message.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 67cf9950723d49ead4ca4ba8e1d7ed393e181ba0 Mon Sep 17 00:00:00 2001
From: Weblate
Date: Wed, 22 Jan 2025 19:52:06 +0000
Subject: [PATCH 06/44] Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Translation: social-17.0/social-17.0-mail_forward
Translate-URL: https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_forward/
---
mail_forward/i18n/es.po | 39 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
diff --git a/mail_forward/i18n/es.po b/mail_forward/i18n/es.po
index c33ce8127..79f1c7433 100644
--- a/mail_forward/i18n/es.po
+++ b/mail_forward/i18n/es.po
@@ -18,12 +18,14 @@ msgstr ""
"X-Generator: Poedit 3.0.1\n"
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#, python-format
msgid "---------- Forwarded message ---------"
msgstr "---------- Mensaje reenviado ---------"
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#, python-format
msgid "Date"
@@ -40,7 +42,16 @@ msgid "Email composition wizard"
msgstr "Asistente de composición de correos electrónicos"
#. module: mail_forward
-#. openerp-web
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#: code:addons/mail_forward/static/src/core/common/message_actions.esm.js:0
+#, python-format
+msgid "Forward"
+msgstr ""
+
+#. module: mail_forward
+#. odoo-javascript
+#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
#, python-format
@@ -48,12 +59,35 @@ msgid "Forward Message"
msgstr "Reenviar mensaje"
#. module: mail_forward
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message Center"
+msgstr ""
+
+#. module: mail_forward
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message Left"
+msgstr ""
+
+#. module: mail_forward
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message Right"
+msgstr ""
+
+#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#, python-format
msgid "From"
msgstr "De"
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/wizards/mail_compose_message.py:0
#, python-format
msgid "Fwd:"
@@ -65,18 +99,21 @@ msgid "Message"
msgstr "Mensaje"
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/wizards/mail_compose_message.py:0
#, python-format
msgid "Re:"
msgstr ""
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#, python-format
msgid "Subject"
msgstr "Asunto"
#. module: mail_forward
+#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#, python-format
msgid "To"
From cc51a33cecf903e973ba011a0f8650bb45387b09 Mon Sep 17 00:00:00 2001
From: Carlos Lopez
Date: Thu, 23 Jan 2025 09:41:59 -0500
Subject: [PATCH 07/44] Revert "[FIX] mail_forward: Render message actions
correctly with callComponent"
This reverts commit ea11305f949dd57a5e27b07ade5a39fe668af780.
---
mail_forward/README.rst | 2 +-
mail_forward/__manifest__.py | 2 +-
mail_forward/static/description/index.html | 2 +-
.../static/src/core/common/message.xml | 31 -------------------
.../src/core/common/message_actions.esm.js | 2 +-
5 files changed, 4 insertions(+), 35 deletions(-)
delete mode 100644 mail_forward/static/src/core/common/message.xml
diff --git a/mail_forward/README.rst b/mail_forward/README.rst
index 330d938ad..383983f52 100644
--- a/mail_forward/README.rst
+++ b/mail_forward/README.rst
@@ -7,7 +7,7 @@ Mail Forward Message
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:aaa71d008cc1c6a1fe737e7a99a760431d3442126800ceb78f5c6a09f0b01727
+ !! source digest: sha256:0307037e538d1434f582ad57d4235cacac01059cfb7bb41d178ea058105525e0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
diff --git a/mail_forward/__manifest__.py b/mail_forward/__manifest__.py
index 7eb972af2..19534c2d1 100644
--- a/mail_forward/__manifest__.py
+++ b/mail_forward/__manifest__.py
@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Mail Forward Message",
- "version": "17.0.1.0.0",
+ "version": "17.0.1.0.1",
"summary": "Forward messages from the chatter of any document to other users.",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social",
diff --git a/mail_forward/static/description/index.html b/mail_forward/static/description/index.html
index abaa040f4..3d1338e7d 100644
--- a/mail_forward/static/description/index.html
+++ b/mail_forward/static/description/index.html
@@ -367,7 +367,7 @@ Mail Forward Message
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:aaa71d008cc1c6a1fe737e7a99a760431d3442126800ceb78f5c6a09f0b01727
+!! source digest: sha256:0307037e538d1434f582ad57d4235cacac01059cfb7bb41d178ea058105525e0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

This module allows users to forward messages from the chatter of any
diff --git a/mail_forward/static/src/core/common/message.xml b/mail_forward/static/src/core/common/message.xml
deleted file mode 100644
index 5c43a72c6..000000000
--- a/mail_forward/static/src/core/common/message.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mail_forward/static/src/core/common/message_actions.esm.js b/mail_forward/static/src/core/common/message_actions.esm.js
index 37b7fb019..dcc9ace71 100644
--- a/mail_forward/static/src/core/common/message_actions.esm.js
+++ b/mail_forward/static/src/core/common/message_actions.esm.js
@@ -12,6 +12,6 @@ messageActionsRegistry.add("forward", {
props: (component) => ({message: component.props.message}),
condition: (component) =>
component.props.message.is_discussion && !component.props.message.is_note,
- sequence: 15,
+ sequence: 75,
title: _t("Forward"),
});
From de96aa5ba2e7edc7fb61ab4fd15f7905311ba39f Mon Sep 17 00:00:00 2001
From: mymage
Date: Sat, 25 Jan 2025 12:51:17 +0000
Subject: [PATCH 08/44] Added translation using Weblate (Italian)
---
mail_forward/i18n/it.po | 120 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 120 insertions(+)
create mode 100644 mail_forward/i18n/it.po
diff --git a/mail_forward/i18n/it.po b/mail_forward/i18n/it.po
new file mode 100644
index 000000000..44e21bdb7
--- /dev/null
+++ b/mail_forward/i18n/it.po
@@ -0,0 +1,120 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * mail_forward
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 17.0\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: 2025-01-25 15:06+0000\n"
+"Last-Translator: mymage \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 5.6.2\n"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "---------- Forwarded message ---------"
+msgstr "---------- Messaggio inoltrato ---------"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "Date"
+msgstr "Data"
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_mail_thread
+msgid "Email Thread"
+msgstr "Discussione e-mail"
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_mail_compose_message
+msgid "Email composition wizard"
+msgstr "Procedura guidata creazione e-mail"
+
+#. module: mail_forward
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#: code:addons/mail_forward/static/src/core/common/message_actions.esm.js:0
+#, python-format
+msgid "Forward"
+msgstr "Inoltra"
+
+#. module: mail_forward
+#. odoo-javascript
+#. odoo-python
+#: code:addons/mail_forward/models/mail_message.py:0
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message"
+msgstr "Inoltra messaggio"
+
+#. module: mail_forward
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message Center"
+msgstr "Centro inoltro messaggio"
+
+#. module: mail_forward
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message Left"
+msgstr "Inoltra messaggio precedente"
+
+#. module: mail_forward
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message Right"
+msgstr "Inoltra messaggio successivo"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "From"
+msgstr "Da"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/wizards/mail_compose_message.py:0
+#, python-format
+msgid "Fwd:"
+msgstr "In.:"
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_mail_message
+msgid "Message"
+msgstr "Messaggio"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/wizards/mail_compose_message.py:0
+#, python-format
+msgid "Re:"
+msgstr "Re:"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "Subject"
+msgstr "Oggetto"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "To"
+msgstr "A"
From b9749a10182f7f1662e379e1eed7c9d07912e657 Mon Sep 17 00:00:00 2001
From: Carlos Lopez
Date: Fri, 24 Jan 2025 12:38:24 -0500
Subject: [PATCH 09/44] =?UTF-8?q?[IMP]=20mail=5Fforward:=20Add=20option=20?=
=?UTF-8?q?to=20forward=20a=20message=20to=20another=20thread=20This=20opt?=
=?UTF-8?q?ion=20posts=20a=20new=20message=20in=20the=20other=20thread,=20?=
=?UTF-8?q?including=20the=20attachments,=20but=20does=20not=20add=20them?=
=?UTF-8?q?=20as=20followers=E2=80=94only=20notifying=20the=20current=20fo?=
=?UTF-8?q?llowers=20of=20the=20other=20thread.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
mail_forward/README.rst | 37 +++-
mail_forward/__manifest__.py | 7 +-
mail_forward/i18n/es.po | 54 +++++-
mail_forward/i18n/mail_forward.pot | 40 ++++
mail_forward/models/__init__.py | 1 +
mail_forward/models/ir_model.py | 9 +
mail_forward/models/mail_message.py | 2 -
mail_forward/models/mail_thread.py | 5 +-
mail_forward/readme/CONFIGURE.md | 5 +
mail_forward/readme/DESCRIPTION.md | 6 +-
mail_forward/readme/USAGE.md | 7 +-
mail_forward/static/description/index.html | 57 ++++--
mail_forward/tests/test_mail_forward.py | 60 +++++-
mail_forward/views/ir_model_views.xml | 19 ++
mail_forward/wizards/mail_compose_message.py | 179 ++++++++++++++++--
.../wizards/mail_compose_message_view.xml | 19 +-
16 files changed, 442 insertions(+), 65 deletions(-)
create mode 100644 mail_forward/models/ir_model.py
create mode 100644 mail_forward/readme/CONFIGURE.md
create mode 100644 mail_forward/views/ir_model_views.xml
diff --git a/mail_forward/README.rst b/mail_forward/README.rst
index 383983f52..330585481 100644
--- a/mail_forward/README.rst
+++ b/mail_forward/README.rst
@@ -7,7 +7,7 @@ Mail Forward Message
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:0307037e538d1434f582ad57d4235cacac01059cfb7bb41d178ea058105525e0
+ !! source digest: sha256:98469f5ef781e247c2d83df22630a8fa703c8ea151e4dbf3c35686d9997d4f09
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -29,14 +29,29 @@ Mail Forward Message
|badge1| |badge2| |badge3| |badge4| |badge5|
This module allows users to forward messages from the chatter of any
-document to other users, adding them as followers of the document
-without notifying the current followers.
+document to:
+
+- Other users in the same thread, adding them as followers of the
+ document without notifying the current followers.
+- Another thread, but not adding them as followers—only notifying the
+ current followers of the other thread.
**Table of contents**
.. contents::
:local:
+Configuration
+=============
+
+To enable a model to forward messages to another thread:
+
+- With debug mode activated, go to
+ ``Settings -> Technical -> Database Structure -> Models``.
+- Search for the model you wish to enable.
+- Mark the option ``Enable Forward To`` and save. Transient models or
+ those without mail thread won't have this check visible.
+
Usage
=====
@@ -47,9 +62,11 @@ To use this module, follow these steps:
notes).
- A Forward icon will appear next to the message.
- Click the button to display a wizard with the message.
-- Select the users to forward the message to.
-- Click the 'Send Mail' button to send the message to the selected
- users.
+- Select the forward type (current thread or another thread).
+- Select the users to forward the message to, or select the other thread
+ according to the previous step.
+- Click the 'Send Mail' button to send the message to the selected users
+ or thread.
Bug Tracker
===========
@@ -89,6 +106,14 @@ 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.
+.. |maintainer-carlos-lopez-tecnativa| image:: https://github.com/carlos-lopez-tecnativa.png?size=40px
+ :target: https://github.com/carlos-lopez-tecnativa
+ :alt: carlos-lopez-tecnativa
+
+Current `maintainer `__:
+
+|maintainer-carlos-lopez-tecnativa|
+
This module is part of the `OCA/social `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/mail_forward/__manifest__.py b/mail_forward/__manifest__.py
index 19534c2d1..c396649fe 100644
--- a/mail_forward/__manifest__.py
+++ b/mail_forward/__manifest__.py
@@ -2,14 +2,12 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Mail Forward Message",
- "version": "17.0.1.0.1",
+ "version": "17.0.2.0.0",
"summary": "Forward messages from the chatter of any document to other users.",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social",
"depends": ["mail", "contacts"],
- "data": [
- "wizards/mail_compose_message_view.xml",
- ],
+ "data": ["wizards/mail_compose_message_view.xml", "views/ir_model_views.xml"],
"assets": {
"web.assets_backend": [
"mail_forward/static/src/**/*.esm.js",
@@ -22,4 +20,5 @@
"installable": True,
"auto_install": False,
"license": "AGPL-3",
+ "maintainers": ["carlos-lopez-tecnativa"],
}
diff --git a/mail_forward/i18n/es.po b/mail_forward/i18n/es.po
index 79f1c7433..62f8ebcf7 100644
--- a/mail_forward/i18n/es.po
+++ b/mail_forward/i18n/es.po
@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 15.0\n"
+"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-10-02 12:25+0000\n"
-"PO-Revision-Date: 2024-10-02 07:27-0500\n"
+"POT-Creation-Date: 2025-01-27 17:26+0000\n"
+"PO-Revision-Date: 2025-01-27 12:28-0500\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
@@ -15,7 +15,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 3.0.1\n"
+"X-Generator: Poedit 3.5\n"
#. module: mail_forward
#. odoo-python
@@ -24,6 +24,16 @@ msgstr ""
msgid "---------- Forwarded message ---------"
msgstr "---------- Mensaje reenviado ---------"
+#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__another_thread
+msgid "Another thread"
+msgstr "Otro hilo"
+
+#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__current_thread
+msgid "Current thread"
+msgstr "Hilo actual"
+
#. module: mail_forward
#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
@@ -39,7 +49,22 @@ msgstr "Hilo de correos electrónicos"
#. module: mail_forward
#: model:ir.model,name:mail_forward.model_mail_compose_message
msgid "Email composition wizard"
-msgstr "Asistente de composición de correos electrónicos"
+msgstr "Asistente de redacción de correo electrónico"
+
+#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_ir_model__enable_forward_to
+msgid "Enable Forward To"
+msgstr "Habilitar reenvío a"
+
+#. module: mail_forward
+#: model:ir.model.fields,help:mail_forward.field_ir_model__enable_forward_to
+msgid "Enable forwarding messages to records of this model."
+msgstr "Habilita el reenvío de mensajes a registros de este modelo."
+
+#. module: mail_forward
+#: model_terms:ir.ui.view,arch_db:mail_forward.mail_compose_message_forward_form
+msgid "Followers to notify"
+msgstr "Seguidores a notificar"
#. module: mail_forward
#. odoo-javascript
@@ -47,7 +72,7 @@ msgstr "Asistente de composición de correos electrónicos"
#: code:addons/mail_forward/static/src/core/common/message_actions.esm.js:0
#, python-format
msgid "Forward"
-msgstr ""
+msgstr "Reenviar"
#. module: mail_forward
#. odoo-javascript
@@ -79,6 +104,11 @@ msgstr ""
msgid "Forward Message Right"
msgstr ""
+#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_type
+msgid "Forward Type"
+msgstr "Tipo de reenvío"
+
#. module: mail_forward
#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
@@ -91,13 +121,18 @@ msgstr "De"
#: code:addons/mail_forward/wizards/mail_compose_message.py:0
#, python-format
msgid "Fwd:"
-msgstr ""
+msgstr "RV:"
#. module: mail_forward
#: model:ir.model,name:mail_forward.model_mail_message
msgid "Message"
msgstr "Mensaje"
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_ir_model
+msgid "Models"
+msgstr "Modelos"
+
#. module: mail_forward
#. odoo-python
#: code:addons/mail_forward/wizards/mail_compose_message.py:0
@@ -112,6 +147,11 @@ msgstr ""
msgid "Subject"
msgstr "Asunto"
+#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_thread
+msgid "Thread to forward"
+msgstr "Hilo a reenviar"
+
#. module: mail_forward
#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
diff --git a/mail_forward/i18n/mail_forward.pot b/mail_forward/i18n/mail_forward.pot
index 17da3d1ee..825a81c03 100644
--- a/mail_forward/i18n/mail_forward.pot
+++ b/mail_forward/i18n/mail_forward.pot
@@ -20,6 +20,16 @@ msgstr ""
msgid "---------- Forwarded message ---------"
msgstr ""
+#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__another_thread
+msgid "Another thread"
+msgstr ""
+
+#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__current_thread
+msgid "Current thread"
+msgstr ""
+
#. module: mail_forward
#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
@@ -37,6 +47,21 @@ msgstr ""
msgid "Email composition wizard"
msgstr ""
+#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_ir_model__enable_forward_to
+msgid "Enable Forward To"
+msgstr ""
+
+#. module: mail_forward
+#: model:ir.model.fields,help:mail_forward.field_ir_model__enable_forward_to
+msgid "Enable forwarding messages to records of this model."
+msgstr ""
+
+#. module: mail_forward
+#: model_terms:ir.ui.view,arch_db:mail_forward.mail_compose_message_forward_form
+msgid "Followers to notify"
+msgstr ""
+
#. module: mail_forward
#. odoo-javascript
#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
@@ -76,6 +101,11 @@ msgstr ""
msgid "Forward Message Right"
msgstr ""
+#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_type
+msgid "Forward Type"
+msgstr ""
+
#. module: mail_forward
#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
@@ -95,6 +125,11 @@ msgstr ""
msgid "Message"
msgstr ""
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_ir_model
+msgid "Models"
+msgstr ""
+
#. module: mail_forward
#. odoo-python
#: code:addons/mail_forward/wizards/mail_compose_message.py:0
@@ -109,6 +144,11 @@ msgstr ""
msgid "Subject"
msgstr ""
+#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_thread
+msgid "Thread to forward"
+msgstr ""
+
#. module: mail_forward
#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
diff --git a/mail_forward/models/__init__.py b/mail_forward/models/__init__.py
index eccc2881b..c5692d315 100644
--- a/mail_forward/models/__init__.py
+++ b/mail_forward/models/__init__.py
@@ -1,2 +1,3 @@
+from . import ir_model
from . import mail_message
from . import mail_thread
diff --git a/mail_forward/models/ir_model.py b/mail_forward/models/ir_model.py
new file mode 100644
index 000000000..8ded28e17
--- /dev/null
+++ b/mail_forward/models/ir_model.py
@@ -0,0 +1,9 @@
+from odoo import fields, models
+
+
+class IrModel(models.Model):
+ _inherit = "ir.model"
+
+ enable_forward_to = fields.Boolean(
+ help="Enable forwarding messages to records of this model."
+ )
diff --git a/mail_forward/models/mail_message.py b/mail_forward/models/mail_message.py
index 57a68cfbe..a6c18e3db 100644
--- a/mail_forward/models/mail_message.py
+++ b/mail_forward/models/mail_message.py
@@ -19,8 +19,6 @@ def action_wizard_forward(self):
"default_model": self.model,
"default_res_ids": [self.res_id],
"default_composition_mode": "comment",
- "default_body": self._build_message_body_for_forward(),
- "default_attachment_ids": self.attachment_ids.ids,
"default_is_log": False,
"default_notify": True,
"force_email": True,
diff --git a/mail_forward/models/mail_thread.py b/mail_forward/models/mail_thread.py
index babb29db5..919c8747d 100644
--- a/mail_forward/models/mail_thread.py
+++ b/mail_forward/models/mail_thread.py
@@ -9,7 +9,10 @@ class MailThread(models.AbstractModel):
def _notify_get_recipients(self, message, msg_vals, **kwargs):
recipients_data = super()._notify_get_recipients(message, msg_vals, **kwargs)
# only notify to explicit partners, remove others(followers).
- if self.env.context.get("message_forwarded_id"):
+ if (
+ self.env.context.get("message_forwarded_id")
+ and self.env.context.get("forward_type", "") == "current_thread"
+ ):
current_partners_ids = message.partner_ids.ids
new_recipeints = []
for recipeint in recipients_data:
diff --git a/mail_forward/readme/CONFIGURE.md b/mail_forward/readme/CONFIGURE.md
new file mode 100644
index 000000000..68629226b
--- /dev/null
+++ b/mail_forward/readme/CONFIGURE.md
@@ -0,0 +1,5 @@
+To enable a model to forward messages to another thread:
+
+- With debug mode activated, go to `Settings -> Technical -> Database Structure -> Models`.
+- Search for the model you wish to enable.
+- Mark the option `Enable Forward To` and save. Transient models or those without mail thread won't have this check visible.
\ No newline at end of file
diff --git a/mail_forward/readme/DESCRIPTION.md b/mail_forward/readme/DESCRIPTION.md
index fe56c5546..872600afc 100644
--- a/mail_forward/readme/DESCRIPTION.md
+++ b/mail_forward/readme/DESCRIPTION.md
@@ -1,3 +1,3 @@
-This module allows users to forward messages from the chatter of any
-document to other users, adding them as followers of the document
-without notifying the current followers.
+This module allows users to forward messages from the chatter of any document to:
+- Other users in the same thread, adding them as followers of the document without notifying the current followers.
+- Another thread, but not adding them as followers—only notifying the current followers of the other thread.
\ No newline at end of file
diff --git a/mail_forward/readme/USAGE.md b/mail_forward/readme/USAGE.md
index 0befa7862..18fc63e58 100644
--- a/mail_forward/readme/USAGE.md
+++ b/mail_forward/readme/USAGE.md
@@ -5,6 +5,7 @@ To use this module, follow these steps:
notes).
- A Forward icon will appear next to the message.
- Click the button to display a wizard with the message.
-- Select the users to forward the message to.
-- Click the 'Send Mail' button to send the message to the selected
- users.
+- Select the forward type (current thread or another thread).
+- Select the users to forward the message to, or select the other thread according to the previous step.
+- Click the 'Send Mail' button to send the message to the selected users or thread.
+
\ No newline at end of file
diff --git a/mail_forward/static/description/index.html b/mail_forward/static/description/index.html
index 3d1338e7d..69529d530 100644
--- a/mail_forward/static/description/index.html
+++ b/mail_forward/static/description/index.html
@@ -367,27 +367,44 @@ Mail Forward Message
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:0307037e538d1434f582ad57d4235cacac01059cfb7bb41d178ea058105525e0
+!! source digest: sha256:98469f5ef781e247c2d83df22630a8fa703c8ea151e4dbf3c35686d9997d4f09
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

This module allows users to forward messages from the chatter of any
-document to other users, adding them as followers of the document
-without notifying the current followers.
+document to:
+
+- Other users in the same thread, adding them as followers of the
+document without notifying the current followers.
+- Another thread, but not adding them as followers—only notifying the
+current followers of the other thread.
+
Table of contents
+
+
+
To enable a model to forward messages to another thread:
+
+- With debug mode activated, go to
+Settings -> Technical -> Database Structure -> Models.
+- Search for the model you wish to enable.
+- Mark the option Enable Forward To and save. Transient models or
+those without mail thread won’t have this check visible.
+
+
-
+
To use this module, follow these steps:
- Navigate to the chatter of any document.
@@ -395,13 +412,15 @@
notes).
- A Forward icon will appear next to the message.
- Click the button to display a wizard with the message.
-- Select the users to forward the message to.
-- Click the ‘Send Mail’ button to send the message to the selected
-users.
+- Select the forward type (current thread or another thread).
+- Select the users to forward the message to, or select the other thread
+according to the previous step.
+- Click the ‘Send Mail’ button to send the message to the selected users
+or thread.
-
+
Bugs are tracked on GitHub 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
@@ -409,15 +428,15 @@
Do not contact contributors directly about support or help with technical issues.
-
+
diff --git a/mail_forward/tests/test_mail_forward.py b/mail_forward/tests/test_mail_forward.py
index 88f311bf4..412c6c36d 100644
--- a/mail_forward/tests/test_mail_forward.py
+++ b/mail_forward/tests/test_mail_forward.py
@@ -22,6 +22,7 @@ def setUpClass(cls):
cls.partner_forward = cls.env["res.partner"].create(
{"name": "Forward", "email": "forward@example.com"}
)
+ cls.env["ir.model"]._get("res.partner").enable_forward_to = True
def test_01_mail_forward(self):
"""
@@ -39,7 +40,7 @@ def test_01_mail_forward(self):
composer = composer_form.save()
with self.mock_mail_gateway():
composer._action_send_mail()
- # Verify recipients of mail.message
+ # Verify the followers of mail.message
message = self.test_record.message_ids[0]
self.assertEqual(len(message.partner_ids), 2)
self.assertIn(self.partner_follower1, message.partner_ids)
@@ -62,13 +63,68 @@ def test_01_mail_forward(self):
with RecordCapturer(self.env["mail.message"], message_domain) as capture:
with self.mock_mail_gateway():
composer._action_send_mail()
- # Verify recipients of mail.message
+ # Verify the followers of mail.message
forward_message = capture.records
self.assertEqual(len(forward_message.partner_ids), 1)
self.assertNotIn(self.partner_follower1, forward_message.partner_ids)
self.assertIn(self.partner_forward, forward_message.partner_ids)
self.assertIn("---------- Forwarded message ---------", forward_message.body)
+ def test_mail_forward_another_thread(self):
+ """
+ Check that the email is forwarded to another thread.
+ and the email is sent to the followers of the another thread.
+ """
+ ctx = {
+ "default_model": self.test_record._name,
+ "default_res_ids": [self.test_record.id],
+ }
+ composer_form = Form(self.env["mail.compose.message"].with_context(**ctx))
+ composer_form.body = "
Hello
"
+ composer_form.subject = "Test Forward"
+ composer_form.partner_ids.add(self.partner_follower1)
+ composer = composer_form.save()
+ with self.mock_mail_gateway():
+ composer._action_send_mail()
+ # Verify the followers of mail.message
+ message = self.test_record.message_ids[0]
+ self.assertEqual(len(message.partner_ids), 1)
+ self.assertIn(self.partner_follower1, message.partner_ids)
+ self.assertNotIn(self.partner_follower2, message.partner_ids)
+ self.assertNotIn(self.partner_forward, message.partner_ids)
+ self.assertNotIn("---------- Forwarded message ---------", message.body)
+ # Forward the email to another record(self.partner_forward)
+ action_forward = message.action_wizard_forward()
+ Message = self.env["mail.compose.message"].with_context(
+ **action_forward["context"]
+ )
+ composer_form = Form(Message, view=action_forward["views"][0][0])
+ composer_form.partner_ids.add(self.partner_follower2)
+ composer_form.forward_type = "another_thread"
+ composer_form.forward_thread = (
+ f"{self.partner_forward._name},{self.partner_forward.id}"
+ )
+ composer = composer_form.save()
+ message_domain = [
+ ("model", "=", self.partner_forward._name),
+ ("res_id", "=", self.partner_forward.id),
+ ]
+ with RecordCapturer(self.env["mail.message"], message_domain) as capture:
+ with self.mock_mail_gateway():
+ composer._action_send_mail()
+ # Verify the followers of mail.message
+ forward_message = capture.records
+ self.assertEqual(forward_message.subject, "Fwd: Test Forward")
+ self.assertEqual(len(forward_message.partner_ids), 1)
+ self.assertNotIn(self.partner_follower1, forward_message.partner_ids)
+ # the partner partner_follower2 is added to the message
+ # but is not added as a follower automatically.
+ self.assertIn(self.partner_follower2, forward_message.partner_ids)
+ self.assertNotIn(
+ self.partner_follower2, self.partner_forward.message_partner_ids
+ )
+ self.assertIn("---------- Forwarded message ---------", forward_message.body)
+
def test_02_mail_forward_tour(self):
self.test_record.message_post(
body="Hello World", message_type="comment", subtype_xmlid="mail.mt_comment"
diff --git a/mail_forward/views/ir_model_views.xml b/mail_forward/views/ir_model_views.xml
new file mode 100644
index 000000000..d45e61f33
--- /dev/null
+++ b/mail_forward/views/ir_model_views.xml
@@ -0,0 +1,19 @@
+
+
+
+
+ view.ir.model.form
+ ir.model
+
+
+
+
+
+
+
+
+
diff --git a/mail_forward/wizards/mail_compose_message.py b/mail_forward/wizards/mail_compose_message.py
index cb36069e2..8b50e86c7 100644
--- a/mail_forward/wizards/mail_compose_message.py
+++ b/mail_forward/wizards/mail_compose_message.py
@@ -1,11 +1,168 @@
# Copyright 2024 Tecnativa - Carlos Lopez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
-from odoo import Command, _, api, models
+from odoo import _, api, fields, models
class MailComposeMessage(models.TransientModel):
_inherit = "mail.compose.message"
+ forward_type = fields.Selection(
+ [
+ ("current_thread", "Current thread"),
+ ("another_thread", "Another thread"),
+ ],
+ default="current_thread",
+ )
+ forward_thread = fields.Reference(
+ selection="_selection_forward_thread", string="Thread to forward"
+ )
+
+ @api.model
+ def _selection_forward_thread(self):
+ # Get all models available to be selected by the user.
+ # Only consider models that support posted messages and are not transient.
+ models = (
+ self.env["ir.model"]
+ .sudo()
+ .search(
+ [
+ ("transient", "=", False),
+ ("is_mail_thread", "=", True),
+ ("enable_forward_to", "=", True),
+ ],
+ order="name asc",
+ )
+ )
+ selection_values = []
+ for model in models:
+ if (
+ model.model in self.env and self.env[model.model]._auto
+ ): # No Abstract models or reports
+ selection_values.append((model.model, model.name))
+ return selection_values
+
+ @api.depends(
+ "composition_mode",
+ "model",
+ "res_domain",
+ "res_ids",
+ "template_id",
+ "forward_type",
+ )
+ @api.depends_context("message_forwarded_id")
+ def _compute_attachment_ids(self):
+ # Save the attachments before calling super() to avoid losing them
+ # because when template_id is not set,
+ # attachment_ids is set to False in the super() call.
+ old_attachments = {composer.id: composer.attachment_ids for composer in self}
+ res = super()._compute_attachment_ids()
+ if self.env.context.get("message_forwarded_id"):
+ # Add the attachments from the original message.
+ message_forwarded = self.env["mail.message"].browse(
+ self.env.context["message_forwarded_id"]
+ )
+ for composer in self:
+ composer.attachment_ids |= old_attachments[composer.id]
+ for attachment in message_forwarded.attachment_ids:
+ composer.attachment_ids |= attachment
+ return res
+
+ @api.depends(
+ "composition_mode",
+ "model",
+ "res_domain",
+ "res_ids",
+ "template_id",
+ "forward_type",
+ "forward_thread",
+ )
+ @api.depends_context("message_forwarded_id")
+ def _compute_body(self):
+ res = super()._compute_body()
+ if self.env.context.get("message_forwarded_id"):
+ # Set the body by default, taking it from the original message.
+ message_forwarded = self.env["mail.message"].browse(
+ self.env.context["message_forwarded_id"]
+ )
+ for composer in self.filtered(lambda c: not c.body):
+ composer.body = message_forwarded._build_message_body_for_forward()
+ return res
+
+ @api.depends(
+ "composition_mode",
+ "model",
+ "parent_id",
+ "record_name",
+ "res_domain",
+ "res_ids",
+ "template_id",
+ "forward_type",
+ "forward_thread",
+ )
+ @api.depends_context("message_forwarded_id")
+ def _compute_subject(self):
+ res = super()._compute_subject()
+ if self.env.context.get("message_forwarded_id"):
+ # Set the subject by default,
+ # because when change the model and res_ids,
+ # the subject is taken from the new record.
+ message_forwarded = self.env["mail.message"].browse(
+ self.env.context["message_forwarded_id"]
+ )
+ for composer in self:
+ composer.subject = f"{_('Fwd:')} {message_forwarded.subject}"
+ return res
+
+ @api.depends("composition_mode", "parent_id", "forward_type", "forward_thread")
+ @api.depends_context("message_forwarded_id")
+ def _compute_model(self):
+ res = super()._compute_model()
+ if self.env.context.get("message_forwarded_id"):
+ # Set the model to the record to be forwarded
+ # if the composer is set to forward a record
+ # it sends the message to the record to be forwarded
+ for composer in self.filtered(
+ lambda c: c.forward_type == "another_thread" and c.forward_thread
+ ):
+ composer.model = composer.forward_thread._name
+ return res
+
+ @api.depends("composition_mode", "parent_id", "forward_type", "forward_thread")
+ @api.depends_context("message_forwarded_id")
+ def _compute_res_ids(self):
+ res = super()._compute_res_ids()
+ if self.env.context.get("message_forwarded_id"):
+ # Set res_ids to the record to be forwarded
+ # if the composer is set to forward a record
+ # it sends the message to the record to be forwarded
+ for composer in self.filtered(
+ lambda c: c.forward_type == "another_thread" and c.forward_thread
+ ):
+ composer.res_ids = composer.forward_thread.ids
+ return res
+
+ @api.depends(
+ "composition_mode",
+ "model",
+ "parent_id",
+ "res_domain",
+ "res_ids",
+ "template_id",
+ "forward_type",
+ )
+ @api.depends_context("message_forwarded_id")
+ def _compute_partner_ids(self):
+ # Save the partner_ids before calling super() to avoid losing them
+ # because when template_id is not set,
+ # partner_ids is set to False in the super() call.
+ old_partners = {composer.id: composer.partner_ids for composer in self}
+ res = super()._compute_partner_ids()
+ if self.env.context.get("message_forwarded_id"):
+ # Add the attachments from the original message.
+ for composer in self:
+ composer.partner_ids |= old_partners[composer.id]
+ return res
+
@api.model
def get_record_data(self, values):
result = super().get_record_data(values)
@@ -20,20 +177,6 @@ def get_record_data(self, values):
return result
def _action_send_mail(self, auto_commit=False):
- # duplicate attachments from original message
- message_forwarded_id = self.env.context.get("message_forwarded_id")
- if message_forwarded_id:
- message_forwarded = self.env["mail.message"].browse(message_forwarded_id)
- for wizard in self:
- new_attachment_ids = []
- for attachment in wizard.attachment_ids:
- if attachment in message_forwarded.attachment_ids:
- new_attachment = attachment.copy(
- {"res_model": "mail.compose.message", "res_id": wizard.id}
- )
- new_attachment_ids.append(new_attachment.id)
- else:
- new_attachment_ids.append(attachment.id)
- new_attachment_ids.reverse()
- wizard.write({"attachment_ids": [Command.set(new_attachment_ids)]})
- return super()._action_send_mail(auto_commit=auto_commit)
+ return super(
+ MailComposeMessage, self.with_context(forward_type=self.forward_type)
+ )._action_send_mail(auto_commit=auto_commit)
diff --git a/mail_forward/wizards/mail_compose_message_view.xml b/mail_forward/wizards/mail_compose_message_view.xml
index 1327be8d2..d6e758777 100644
--- a/mail_forward/wizards/mail_compose_message_view.xml
+++ b/mail_forward/wizards/mail_compose_message_view.xml
@@ -7,8 +7,25 @@
+
+
+
+
- 1
+ forward_type == 'current_thread'
+
+
+ Followers to notify
1
From f5fbd6b6be4546b34399ef15b84b1c6904dce2c2 Mon Sep 17 00:00:00 2001
From: Weblate
Date: Tue, 28 Jan 2025 18:44:26 +0000
Subject: [PATCH 10/44] Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Translation: social-17.0/social-17.0-mail_forward
Translate-URL: https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_forward/
---
mail_forward/i18n/it.po | 41 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
diff --git a/mail_forward/i18n/it.po b/mail_forward/i18n/it.po
index 44e21bdb7..eaa38e7ce 100644
--- a/mail_forward/i18n/it.po
+++ b/mail_forward/i18n/it.po
@@ -23,6 +23,16 @@ msgstr ""
msgid "---------- Forwarded message ---------"
msgstr "---------- Messaggio inoltrato ---------"
+#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__another_thread
+msgid "Another thread"
+msgstr ""
+
+#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__current_thread
+msgid "Current thread"
+msgstr ""
+
#. module: mail_forward
#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
@@ -40,6 +50,21 @@ msgstr "Discussione e-mail"
msgid "Email composition wizard"
msgstr "Procedura guidata creazione e-mail"
+#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_ir_model__enable_forward_to
+msgid "Enable Forward To"
+msgstr ""
+
+#. module: mail_forward
+#: model:ir.model.fields,help:mail_forward.field_ir_model__enable_forward_to
+msgid "Enable forwarding messages to records of this model."
+msgstr ""
+
+#. module: mail_forward
+#: model_terms:ir.ui.view,arch_db:mail_forward.mail_compose_message_forward_form
+msgid "Followers to notify"
+msgstr ""
+
#. module: mail_forward
#. odoo-javascript
#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
@@ -53,7 +78,6 @@ msgstr "Inoltra"
#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
-#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
#, python-format
msgid "Forward Message"
msgstr "Inoltra messaggio"
@@ -79,6 +103,11 @@ msgstr "Inoltra messaggio precedente"
msgid "Forward Message Right"
msgstr "Inoltra messaggio successivo"
+#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_type
+msgid "Forward Type"
+msgstr ""
+
#. module: mail_forward
#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
@@ -98,6 +127,11 @@ msgstr "In.:"
msgid "Message"
msgstr "Messaggio"
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_ir_model
+msgid "Models"
+msgstr ""
+
#. module: mail_forward
#. odoo-python
#: code:addons/mail_forward/wizards/mail_compose_message.py:0
@@ -112,6 +146,11 @@ msgstr "Re:"
msgid "Subject"
msgstr "Oggetto"
+#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_thread
+msgid "Thread to forward"
+msgstr ""
+
#. module: mail_forward
#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
From fd8907a66e8f9470b619ce1faf3e93c3a87a858c Mon Sep 17 00:00:00 2001
From: mymage
Date: Thu, 30 Jan 2025 10:42:26 +0000
Subject: [PATCH 11/44] Translated using Weblate (Italian)
Currently translated at 100.0% (23 of 23 strings)
Translation: social-17.0/social-17.0-mail_forward
Translate-URL: https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_forward/it/
---
mail_forward/i18n/it.po | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/mail_forward/i18n/it.po b/mail_forward/i18n/it.po
index eaa38e7ce..2327f0ce5 100644
--- a/mail_forward/i18n/it.po
+++ b/mail_forward/i18n/it.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2025-01-25 15:06+0000\n"
+"PO-Revision-Date: 2025-01-30 13:06+0000\n"
"Last-Translator: mymage \n"
"Language-Team: none\n"
"Language: it\n"
@@ -26,12 +26,12 @@ msgstr "---------- Messaggio inoltrato ---------"
#. module: mail_forward
#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__another_thread
msgid "Another thread"
-msgstr ""
+msgstr "Un'altra discussione"
#. module: mail_forward
#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__current_thread
msgid "Current thread"
-msgstr ""
+msgstr "Discussione attuale"
#. module: mail_forward
#. odoo-python
@@ -53,17 +53,17 @@ msgstr "Procedura guidata creazione e-mail"
#. module: mail_forward
#: model:ir.model.fields,field_description:mail_forward.field_ir_model__enable_forward_to
msgid "Enable Forward To"
-msgstr ""
+msgstr "Abilita inoltro a"
#. module: mail_forward
#: model:ir.model.fields,help:mail_forward.field_ir_model__enable_forward_to
msgid "Enable forwarding messages to records of this model."
-msgstr ""
+msgstr "Abilita messaggi inoltro ai record di questo modello."
#. module: mail_forward
#: model_terms:ir.ui.view,arch_db:mail_forward.mail_compose_message_forward_form
msgid "Followers to notify"
-msgstr ""
+msgstr "Sottoscritti da avvisare"
#. module: mail_forward
#. odoo-javascript
@@ -106,7 +106,7 @@ msgstr "Inoltra messaggio successivo"
#. module: mail_forward
#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_type
msgid "Forward Type"
-msgstr ""
+msgstr "Tipo inoltro"
#. module: mail_forward
#. odoo-python
@@ -130,7 +130,7 @@ msgstr "Messaggio"
#. module: mail_forward
#: model:ir.model,name:mail_forward.model_ir_model
msgid "Models"
-msgstr ""
+msgstr "Modelli"
#. module: mail_forward
#. odoo-python
@@ -149,7 +149,7 @@ msgstr "Oggetto"
#. module: mail_forward
#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_thread
msgid "Thread to forward"
-msgstr ""
+msgstr "Discussione da inoltrare"
#. module: mail_forward
#. odoo-python
From 8013f89f4ca29ad45adf136154ba792c77e298e5 Mon Sep 17 00:00:00 2001
From: Carlos Lopez
Date: Wed, 12 Feb 2025 06:13:59 -0500
Subject: [PATCH 12/44] [FIX] mail_forward: Avoid error when forwarding a
message while reading the view ir.ui.view requires base.group_system
permission to read, so sudo is used instead.
---
mail_forward/README.rst | 2 +-
mail_forward/__manifest__.py | 2 +-
mail_forward/models/mail_message.py | 2 +-
mail_forward/static/description/index.html | 2 +-
mail_forward/tests/test_mail_forward.py | 18 +++++++++++++++---
5 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/mail_forward/README.rst b/mail_forward/README.rst
index 330585481..fbbe0acdb 100644
--- a/mail_forward/README.rst
+++ b/mail_forward/README.rst
@@ -7,7 +7,7 @@ Mail Forward Message
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:98469f5ef781e247c2d83df22630a8fa703c8ea151e4dbf3c35686d9997d4f09
+ !! source digest: sha256:5ef4a37a086e596348f4dcec546d3ceadf405792c3f2c6481397d2ff574839d9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
diff --git a/mail_forward/__manifest__.py b/mail_forward/__manifest__.py
index c396649fe..db8dc53fe 100644
--- a/mail_forward/__manifest__.py
+++ b/mail_forward/__manifest__.py
@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Mail Forward Message",
- "version": "17.0.2.0.0",
+ "version": "17.0.2.0.1",
"summary": "Forward messages from the chatter of any document to other users.",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social",
diff --git a/mail_forward/models/mail_message.py b/mail_forward/models/mail_message.py
index a6c18e3db..9546cde3e 100644
--- a/mail_forward/models/mail_message.py
+++ b/mail_forward/models/mail_message.py
@@ -8,7 +8,7 @@ class MailMessage(models.Model):
_inherit = "mail.message"
def action_wizard_forward(self):
- view = self.env.ref("mail_forward.mail_compose_message_forward_form")
+ view = self.env.ref("mail_forward.mail_compose_message_forward_form").sudo()
action = self.env["ir.actions.actions"]._for_xml_id(
"mail.action_email_compose_message_wizard"
)
diff --git a/mail_forward/static/description/index.html b/mail_forward/static/description/index.html
index 69529d530..cb96bf95f 100644
--- a/mail_forward/static/description/index.html
+++ b/mail_forward/static/description/index.html
@@ -367,7 +367,7 @@ Mail Forward Message
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:98469f5ef781e247c2d83df22630a8fa703c8ea151e4dbf3c35686d9997d4f09
+!! source digest: sha256:5ef4a37a086e596348f4dcec546d3ceadf405792c3f2c6481397d2ff574839d9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

This module allows users to forward messages from the chatter of any
diff --git a/mail_forward/tests/test_mail_forward.py b/mail_forward/tests/test_mail_forward.py
index 412c6c36d..f3df32efd 100644
--- a/mail_forward/tests/test_mail_forward.py
+++ b/mail_forward/tests/test_mail_forward.py
@@ -2,8 +2,9 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.tests import Form, RecordCapturer, tagged
-from odoo.tests.common import HttpCase
+from odoo.tests.common import HttpCase, users
+from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.addons.mail.tests.test_mail_composer import TestMailComposer
@@ -12,6 +13,11 @@ class TestMailForward(TestMailComposer, HttpCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
+ cls.user_test = mail_new_test_user(
+ cls.env,
+ login="user_test_forward",
+ groups="base.group_user,base.group_partner_manager",
+ )
cls.test_record.write({"name": "Test Forward", "email": "test@example.com"})
cls.partner_follower1 = cls.env["res.partner"].create(
{"name": "Follower1", "email": "follower1@example.com"}
@@ -24,6 +30,7 @@ def setUpClass(cls):
)
cls.env["ir.model"]._get("res.partner").enable_forward_to = True
+ @users("user_test_forward")
def test_01_mail_forward(self):
"""
Send an email to followers
@@ -70,6 +77,7 @@ def test_01_mail_forward(self):
self.assertIn(self.partner_forward, forward_message.partner_ids)
self.assertIn("---------- Forwarded message ---------", forward_message.body)
+ @users("user_test_forward")
def test_mail_forward_another_thread(self):
"""
Check that the email is forwarded to another thread.
@@ -125,16 +133,20 @@ def test_mail_forward_another_thread(self):
)
self.assertIn("---------- Forwarded message ---------", forward_message.body)
+ @users("user_test_forward")
def test_02_mail_forward_tour(self):
self.test_record.message_post(
body="Hello World", message_type="comment", subtype_xmlid="mail.mt_comment"
)
- self.start_tour("/web", "mail_forward.mail_forward_tour", login="admin")
+ self.start_tour(
+ "/web", "mail_forward.mail_forward_tour", login="user_test_forward"
+ )
+ @users("user_test_forward")
def test_03_mail_note_not_forward_tour(self):
self.test_record.message_post(
body="This is a note", message_type="comment", subtype_xmlid="mail.mt_note"
)
self.start_tour(
- "/web", "mail_forward.mail_note_not_forward_tour", login="admin"
+ "/web", "mail_forward.mail_note_not_forward_tour", login="user_test_forward"
)
From aa621a4b0866a1494803adefa6d4d474916da0f1 Mon Sep 17 00:00:00 2001
From: jabelchi
Date: Thu, 19 Jun 2025 07:22:32 +0000
Subject: [PATCH 13/44] Added translation using Weblate (Catalan)
---
mail_forward/i18n/ca.po | 160 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 160 insertions(+)
create mode 100644 mail_forward/i18n/ca.po
diff --git a/mail_forward/i18n/ca.po b/mail_forward/i18n/ca.po
new file mode 100644
index 000000000..1654d1e3b
--- /dev/null
+++ b/mail_forward/i18n/ca.po
@@ -0,0 +1,160 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * mail_forward
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 17.0\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: 2025-06-19 09:25+0000\n"
+"Last-Translator: jabelchi \n"
+"Language-Team: none\n"
+"Language: ca\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.4\n"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "---------- Forwarded message ---------"
+msgstr "---------- Missatge reenviat ---------"
+
+#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__another_thread
+msgid "Another thread"
+msgstr "Un altre fil"
+
+#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__current_thread
+msgid "Current thread"
+msgstr "Fil actual"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "Date"
+msgstr "Data"
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_mail_thread
+msgid "Email Thread"
+msgstr "Fil de correus"
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_mail_compose_message
+msgid "Email composition wizard"
+msgstr "Assistent de redacció de correus"
+
+#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_ir_model__enable_forward_to
+msgid "Enable Forward To"
+msgstr "Habilita reenviament"
+
+#. module: mail_forward
+#: model:ir.model.fields,help:mail_forward.field_ir_model__enable_forward_to
+msgid "Enable forwarding messages to records of this model."
+msgstr "Habilita reenviament de missatges a registres d'aquest model."
+
+#. module: mail_forward
+#: model_terms:ir.ui.view,arch_db:mail_forward.mail_compose_message_forward_form
+msgid "Followers to notify"
+msgstr "Seguidors a notificar"
+
+#. module: mail_forward
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#: code:addons/mail_forward/static/src/core/common/message_actions.esm.js:0
+#, python-format
+msgid "Forward"
+msgstr "Reenvia"
+
+#. module: mail_forward
+#. odoo-javascript
+#. odoo-python
+#: code:addons/mail_forward/models/mail_message.py:0
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message"
+msgstr "Reenvia missatge"
+
+#. module: mail_forward
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message Center"
+msgstr ""
+
+#. module: mail_forward
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message Left"
+msgstr ""
+
+#. module: mail_forward
+#. odoo-javascript
+#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
+#, python-format
+msgid "Forward Message Right"
+msgstr ""
+
+#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_type
+msgid "Forward Type"
+msgstr "Tipus de reenviament"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "From"
+msgstr "De"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/wizards/mail_compose_message.py:0
+#, python-format
+msgid "Fwd:"
+msgstr "Rv:"
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_mail_message
+msgid "Message"
+msgstr "Missatge"
+
+#. module: mail_forward
+#: model:ir.model,name:mail_forward.model_ir_model
+msgid "Models"
+msgstr "Models"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/wizards/mail_compose_message.py:0
+#, python-format
+msgid "Re:"
+msgstr "Re:"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "Subject"
+msgstr "Assumpte"
+
+#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_thread
+msgid "Thread to forward"
+msgstr "Fil pel reenviament"
+
+#. module: mail_forward
+#. odoo-python
+#: code:addons/mail_forward/models/mail_message.py:0
+#, python-format
+msgid "To"
+msgstr "A"
From fee86dadd00f41966ab969a3701a72b3a553019b Mon Sep 17 00:00:00 2001
From: oca-ci
Date: Tue, 22 Jul 2025 13:34:08 +0000
Subject: [PATCH 14/44] [UPD] Update mail_forward.pot
---
mail_forward/i18n/mail_forward.pot | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/mail_forward/i18n/mail_forward.pot b/mail_forward/i18n/mail_forward.pot
index 825a81c03..f6433128d 100644
--- a/mail_forward/i18n/mail_forward.pot
+++ b/mail_forward/i18n/mail_forward.pot
@@ -21,11 +21,13 @@ msgid "---------- Forwarded message ---------"
msgstr ""
#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_gateway_message__forward_type__another_thread
#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__another_thread
msgid "Another thread"
msgstr ""
#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_gateway_message__forward_type__current_thread
#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__current_thread
msgid "Current thread"
msgstr ""
@@ -102,6 +104,7 @@ msgid "Forward Message Right"
msgstr ""
#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_gateway_message__forward_type
#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_type
msgid "Forward Type"
msgstr ""
@@ -145,6 +148,7 @@ msgid "Subject"
msgstr ""
#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_gateway_message__forward_thread
#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_thread
msgid "Thread to forward"
msgstr ""
From bf8291af6e4269abfe7c5508b908ee2f3fea01f8 Mon Sep 17 00:00:00 2001
From: Weblate
Date: Tue, 22 Jul 2025 13:41:13 +0000
Subject: [PATCH 15/44] Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Translation: social-17.0/social-17.0-mail_forward
Translate-URL: https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_forward/
---
mail_forward/i18n/ca.po | 5 ++++-
mail_forward/i18n/es.po | 4 ++++
mail_forward/i18n/it.po | 4 ++++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/mail_forward/i18n/ca.po b/mail_forward/i18n/ca.po
index 1654d1e3b..67c8aa5e4 100644
--- a/mail_forward/i18n/ca.po
+++ b/mail_forward/i18n/ca.po
@@ -24,11 +24,13 @@ msgid "---------- Forwarded message ---------"
msgstr "---------- Missatge reenviat ---------"
#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_gateway_message__forward_type__another_thread
#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__another_thread
msgid "Another thread"
msgstr "Un altre fil"
#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_gateway_message__forward_type__current_thread
#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__current_thread
msgid "Current thread"
msgstr "Fil actual"
@@ -78,7 +80,6 @@ msgstr "Reenvia"
#. odoo-python
#: code:addons/mail_forward/models/mail_message.py:0
#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
-#: code:addons/mail_forward/static/src/components/forward_message/forward_message.xml:0
#, python-format
msgid "Forward Message"
msgstr "Reenvia missatge"
@@ -105,6 +106,7 @@ msgid "Forward Message Right"
msgstr ""
#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_gateway_message__forward_type
#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_type
msgid "Forward Type"
msgstr "Tipus de reenviament"
@@ -148,6 +150,7 @@ msgid "Subject"
msgstr "Assumpte"
#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_gateway_message__forward_thread
#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_thread
msgid "Thread to forward"
msgstr "Fil pel reenviament"
diff --git a/mail_forward/i18n/es.po b/mail_forward/i18n/es.po
index 62f8ebcf7..cd270aaf7 100644
--- a/mail_forward/i18n/es.po
+++ b/mail_forward/i18n/es.po
@@ -25,11 +25,13 @@ msgid "---------- Forwarded message ---------"
msgstr "---------- Mensaje reenviado ---------"
#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_gateway_message__forward_type__another_thread
#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__another_thread
msgid "Another thread"
msgstr "Otro hilo"
#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_gateway_message__forward_type__current_thread
#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__current_thread
msgid "Current thread"
msgstr "Hilo actual"
@@ -105,6 +107,7 @@ msgid "Forward Message Right"
msgstr ""
#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_gateway_message__forward_type
#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_type
msgid "Forward Type"
msgstr "Tipo de reenvío"
@@ -148,6 +151,7 @@ msgid "Subject"
msgstr "Asunto"
#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_gateway_message__forward_thread
#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_thread
msgid "Thread to forward"
msgstr "Hilo a reenviar"
diff --git a/mail_forward/i18n/it.po b/mail_forward/i18n/it.po
index 2327f0ce5..97508a7c7 100644
--- a/mail_forward/i18n/it.po
+++ b/mail_forward/i18n/it.po
@@ -24,11 +24,13 @@ msgid "---------- Forwarded message ---------"
msgstr "---------- Messaggio inoltrato ---------"
#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_gateway_message__forward_type__another_thread
#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__another_thread
msgid "Another thread"
msgstr "Un'altra discussione"
#. module: mail_forward
+#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_gateway_message__forward_type__current_thread
#: model:ir.model.fields.selection,name:mail_forward.selection__mail_compose_message__forward_type__current_thread
msgid "Current thread"
msgstr "Discussione attuale"
@@ -104,6 +106,7 @@ msgid "Forward Message Right"
msgstr "Inoltra messaggio successivo"
#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_gateway_message__forward_type
#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_type
msgid "Forward Type"
msgstr "Tipo inoltro"
@@ -147,6 +150,7 @@ msgid "Subject"
msgstr "Oggetto"
#. module: mail_forward
+#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_gateway_message__forward_thread
#: model:ir.model.fields,field_description:mail_forward.field_mail_compose_message__forward_thread
msgid "Thread to forward"
msgstr "Discussione da inoltrare"
From ed6ce164e957267418db05d6dba2a767753618ae Mon Sep 17 00:00:00 2001
From: Carlos Lopez
Date: Wed, 4 Feb 2026 09:26:32 -0500
Subject: [PATCH 16/44] [IMP] mail_forward: auto fixes
---
mail_forward/README.rst | 16 ++++----
mail_forward/__manifest__.py | 2 +-
mail_forward/static/description/index.html | 8 ++--
.../forward_message/forward_message.xml | 38 +++++++++----------
mail_forward/views/ir_model_views.xml | 2 -
5 files changed, 32 insertions(+), 34 deletions(-)
diff --git a/mail_forward/README.rst b/mail_forward/README.rst
index fbbe0acdb..67a46664e 100644
--- a/mail_forward/README.rst
+++ b/mail_forward/README.rst
@@ -16,14 +16,14 @@ Mail Forward Message
.. |badge2| image:: https://img.shields.io/badge/licence-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%2Fsocial-lightgray.png?logo=github
- :target: https://github.com/OCA/social/tree/17.0/mail_forward
- :alt: OCA/social
+.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github
+ :target: https://github.com/OCA/mail/tree/18.0/mail_forward
+ :alt: OCA/mail
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_forward
+ :target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_forward
: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/social&target_branch=17.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=18.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -71,10 +71,10 @@ To use this module, follow these steps:
Bug Tracker
===========
-Bugs are tracked on `GitHub Issues `_.
+Bugs are tracked on `GitHub 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -114,6 +114,6 @@ Current `maintainer `__:
|maintainer-carlos-lopez-tecnativa|
-This module is part of the `OCA/social `_ project on GitHub.
+This module is part of the `OCA/mail `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/mail_forward/__manifest__.py b/mail_forward/__manifest__.py
index db8dc53fe..d88e6fa69 100644
--- a/mail_forward/__manifest__.py
+++ b/mail_forward/__manifest__.py
@@ -5,7 +5,7 @@
"version": "17.0.2.0.1",
"summary": "Forward messages from the chatter of any document to other users.",
"author": "Tecnativa, Odoo Community Association (OCA)",
- "website": "https://github.com/OCA/social",
+ "website": "https://github.com/OCA/mail",
"depends": ["mail", "contacts"],
"data": ["wizards/mail_compose_message_view.xml", "views/ir_model_views.xml"],
"assets": {
diff --git a/mail_forward/static/description/index.html b/mail_forward/static/description/index.html
index cb96bf95f..5288509cd 100644
--- a/mail_forward/static/description/index.html
+++ b/mail_forward/static/description/index.html
@@ -369,7 +369,7 @@ Mail Forward Message
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5ef4a37a086e596348f4dcec546d3ceadf405792c3f2c6481397d2ff574839d9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module allows users to forward messages from the chatter of any
document to:
-
Bugs are tracked on GitHub Issues.
+
Bugs are tracked on GitHub 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.
+
feedback.
Do not contact contributors directly about support or help with technical issues.
diff --git a/mail_forward/static/src/components/forward_message/forward_message.xml b/mail_forward/static/src/components/forward_message/forward_message.xml
index 070664668..cab680d73 100644
--- a/mail_forward/static/src/components/forward_message/forward_message.xml
+++ b/mail_forward/static/src/components/forward_message/forward_message.xml
@@ -9,25 +9,25 @@
t-on-click="onClickForwardMessage"
>
-
-
-
-
+
+
+
+
Forward
diff --git a/mail_forward/views/ir_model_views.xml b/mail_forward/views/ir_model_views.xml
index d45e61f33..5c93fbc06 100644
--- a/mail_forward/views/ir_model_views.xml
+++ b/mail_forward/views/ir_model_views.xml
@@ -1,6 +1,5 @@
-
view.ir.model.form
ir.model
@@ -15,5 +14,4 @@
-
From 4e2d20ca79f3e09a7a1944c33a271975fcdd1711 Mon Sep 17 00:00:00 2001
From: Carlos Lopez
Date: Wed, 4 Feb 2026 13:25:20 -0500
Subject: [PATCH 17/44] [MIG] mail_forward: Migration to version 18.0
---
mail_forward/__manifest__.py | 2 +-
mail_forward/models/mail_message.py | 14 ++++++------
.../forward_message/forward_message.esm.js | 11 ++--------
.../src/core/common/message_actions.esm.js | 3 +--
.../static/tests/tours/mail_forward.esm.js | 22 +++++++++++--------
.../wizards/mail_compose_message_view.xml | 11 ++++------
6 files changed, 28 insertions(+), 35 deletions(-)
diff --git a/mail_forward/__manifest__.py b/mail_forward/__manifest__.py
index d88e6fa69..c9a24f028 100644
--- a/mail_forward/__manifest__.py
+++ b/mail_forward/__manifest__.py
@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Mail Forward Message",
- "version": "17.0.2.0.1",
+ "version": "18.0.1.0.0",
"summary": "Forward messages from the chatter of any document to other users.",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/mail",
diff --git a/mail_forward/models/mail_message.py b/mail_forward/models/mail_message.py
index 9546cde3e..d30a8638e 100644
--- a/mail_forward/models/mail_message.py
+++ b/mail_forward/models/mail_message.py
@@ -1,6 +1,6 @@
# Copyright 2024 Tecnativa - Carlos Lopez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
-from odoo import _, models
+from odoo import models
from odoo.tools import format_datetime
@@ -12,7 +12,7 @@ def action_wizard_forward(self):
action = self.env["ir.actions.actions"]._for_xml_id(
"mail.action_email_compose_message_wizard"
)
- action["name"] = _("Forward Message")
+ action["name"] = self.env._("Forward Message")
action["view_mode"] = view.type
action["views"] = [(view.id, view.type)]
action["context"] = {
@@ -42,14 +42,14 @@ def _build_message_body_for_forward(self):
{body}
""".format(
- str_forwarded_message=_("---------- Forwarded message ---------"),
+ str_forwarded_message=self.env._("---------- Forwarded message ---------"),
email_from=self.email_from,
date=format_datetime(self.env, self.date),
subject=self.subject,
to=", ".join(partner_emails),
- str_date=_("Date"),
- str_subject=_("Subject"),
- str_from=_("From"),
- str_to=_("To"),
+ str_date=self.env._("Date"),
+ str_subject=self.env._("Subject"),
+ str_from=self.env._("From"),
+ str_to=self.env._("To"),
body=self.body,
)
diff --git a/mail_forward/static/src/components/forward_message/forward_message.esm.js b/mail_forward/static/src/components/forward_message/forward_message.esm.js
index 0fc7c0ca2..49d27a536 100644
--- a/mail_forward/static/src/components/forward_message/forward_message.esm.js
+++ b/mail_forward/static/src/components/forward_message/forward_message.esm.js
@@ -1,17 +1,10 @@
-/** @odoo-module **/
/* Copyright 2024 Tecnativa - Carlos Lopez
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
*/
const {Component} = owl;
-import {useService} from "@web/core/utils/hooks";
export class ForwardMessage extends Component {
- setup() {
- super.setup();
- this.threadService = useService("mail.thread");
- }
async onClickForwardMessage() {
- const composer = this.props.message.originThread.composer;
const action = await this.env.services.orm.call(
"mail.message",
"action_wizard_forward",
@@ -24,8 +17,8 @@ export class ForwardMessage extends Component {
active_model: "mail.message",
},
onClose: () => {
- if (composer.thread) {
- this.threadService.fetchNewMessages(composer.thread);
+ if (this.props.message.thread) {
+ this.props.message.thread.fetchNewMessages();
}
},
});
diff --git a/mail_forward/static/src/core/common/message_actions.esm.js b/mail_forward/static/src/core/common/message_actions.esm.js
index dcc9ace71..1d9b78eea 100644
--- a/mail_forward/static/src/core/common/message_actions.esm.js
+++ b/mail_forward/static/src/core/common/message_actions.esm.js
@@ -1,10 +1,9 @@
-/* @odoo-module */
/* Copyright 2024 Tecnativa - Carlos Lopez
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
*/
-import {_t} from "@web/core/l10n/translation";
import {ForwardMessage} from "../../components/forward_message/forward_message.esm";
+import {_t} from "@web/core/l10n/translation";
import {messageActionsRegistry} from "@mail/core/common/message_actions";
messageActionsRegistry.add("forward", {
diff --git a/mail_forward/static/tests/tours/mail_forward.esm.js b/mail_forward/static/tests/tours/mail_forward.esm.js
index 3f4b720fc..b344c0bf0 100644
--- a/mail_forward/static/tests/tours/mail_forward.esm.js
+++ b/mail_forward/static/tests/tours/mail_forward.esm.js
@@ -1,18 +1,18 @@
-/** @odoo-module */
-
import {registry} from "@web/core/registry";
const contact_steps = [
{
trigger: ".o_navbar_apps_menu button",
+ run: "click",
},
{
trigger: '.o_app[data-menu-xmlid="contacts.menu_contacts"]',
+ run: "click",
},
{
content: "Search Contact",
trigger: ".o_searchview_input",
- run: "text Test Forward",
+ run: "edit Test Forward",
},
{
trigger: ".o_menu_item",
@@ -27,6 +27,7 @@ const contact_steps = [
{
content: "Open contact",
trigger: ".o_list_table td[name='complete_name']:contains('Test Forward')",
+ run: "click",
},
];
registry.category("web_tour.tours").add("mail_forward.mail_forward_tour", {
@@ -35,8 +36,13 @@ registry.category("web_tour.tours").add("mail_forward.mail_forward_tour", {
steps: () => [
...contact_steps,
{
- content: "Hover a message",
- trigger: "div.o-mail-Message[aria-label='Message'] button.dropdown-toggle",
+ content: "Hover a message to show actions",
+ trigger: "div.o-mail-Message[aria-label='Message']",
+ run: "hover",
+ },
+ {
+ content: "Click message options button",
+ trigger: "div.o-mail-Message-actions button.dropdown-toggle",
run: "click",
},
{
@@ -47,18 +53,16 @@ registry.category("web_tour.tours").add("mail_forward.mail_forward_tour", {
{
content: "Select a Forward",
trigger: ".o_field_widget[name=partner_ids] input",
- extra_trigger: ".modal-dialog",
- run: "text Forward",
+ run: "edit Forward",
},
{
content: "Valid Forward",
trigger: ".ui-menu-item a:contains(Forward)",
run: "click",
- in_modal: false,
},
{
content: "Send mail",
- trigger: "button[name=action_send_mail]",
+ trigger: "button.o_mail_send",
run: "click",
},
{
diff --git a/mail_forward/wizards/mail_compose_message_view.xml b/mail_forward/wizards/mail_compose_message_view.xml
index d6e758777..e1118b45d 100644
--- a/mail_forward/wizards/mail_compose_message_view.xml
+++ b/mail_forward/wizards/mail_compose_message_view.xml
@@ -27,18 +27,15 @@
Followers to notify
-
- 1
-
-
- 1
-
1
+
+ 1
+
From 516c7ad1102949b859a3bf856cdcd033803170d8 Mon Sep 17 00:00:00 2001
From: Christopher Rogos
Date: Thu, 5 Feb 2026 16:35:15 +0000
Subject: [PATCH 18/44] [IMP] mail_restrict_follower_selection: enhance domain
filtering for follower selection
---
mail_restrict_follower_selection/README.rst | 12 +++++++++---
.../data/ir_config_parameter.xml | 2 +-
.../models/mail_thread.py | 8 +++++++-
.../readme/CONFIGURE.md | 9 ++++++---
.../static/description/index.html | 13 ++++++++++---
5 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/mail_restrict_follower_selection/README.rst b/mail_restrict_follower_selection/README.rst
index d5c9fb0d7..de7c3686b 100644
--- a/mail_restrict_follower_selection/README.rst
+++ b/mail_restrict_follower_selection/README.rst
@@ -52,9 +52,15 @@ certain record type (or have different restrictions for different record
types), create a parameter
mail_restrict_follower_selection.domain.$your_model.
-As an example, you could use [('category_id.name', '=', 'Employees')] to
-allow only contacts with 'Employees' tag to be added as follower - this
-also is the default.
+Some examples:
+
+- ``[("category_id.name", "=", "Employees")]`` : Only allow contacts
+ with 'Employees' tag
+- ``[("is_company", "=", False)]`` : Restrict company contacts to be
+ added as follower (to avoid emails to info@ email address)
+- ``[("user_ids","!=",False)]`` : Restrict to contacts with user
+ (internal and portal)
+- ``[("employee_ids","!=",False)]`` : Restrict to employees
Note: This module won't change existing followers!
diff --git a/mail_restrict_follower_selection/data/ir_config_parameter.xml b/mail_restrict_follower_selection/data/ir_config_parameter.xml
index b44c26557..3b67980c2 100644
--- a/mail_restrict_follower_selection/data/ir_config_parameter.xml
+++ b/mail_restrict_follower_selection/data/ir_config_parameter.xml
@@ -2,6 +2,6 @@
mail_restrict_follower_selection.domain
- [('category_id.name', '=', 'Employees')]
+ []
diff --git a/mail_restrict_follower_selection/models/mail_thread.py b/mail_restrict_follower_selection/models/mail_thread.py
index 56af24527..c12f19b1b 100644
--- a/mail_restrict_follower_selection/models/mail_thread.py
+++ b/mail_restrict_follower_selection/models/mail_thread.py
@@ -1,4 +1,4 @@
-from odoo import models
+from odoo import fields, models
from odoo.tools import config
from odoo.tools.safe_eval import safe_eval
@@ -8,6 +8,12 @@
class MailThread(models.AbstractModel):
_inherit = "mail.thread"
+ message_partner_ids = fields.Many2many(
+ domain=lambda thread: thread.env[
+ "mail.wizard.invite"
+ ]._mail_restrict_follower_selection_get_domain(thread._name)
+ )
+
def _message_add_suggested_recipient(
self, result, partner=None, email=None, lang=None, reason=""
):
diff --git a/mail_restrict_follower_selection/readme/CONFIGURE.md b/mail_restrict_follower_selection/readme/CONFIGURE.md
index 9213b8be1..76836f613 100644
--- a/mail_restrict_follower_selection/readme/CONFIGURE.md
+++ b/mail_restrict_follower_selection/readme/CONFIGURE.md
@@ -5,8 +5,11 @@ certain record type (or have different restrictions for different record
types), create a parameter
mail_restrict_follower_selection.domain.\$your_model.
-As an example, you could use \[('category_id.name', '=', 'Employees')\]
-to allow only contacts with 'Employees' tag to be added as follower -
-this also is the default.
+Some examples:
+
+- `[("category_id.name", "=", "Employees")]` : Only allow contacts with 'Employees' tag
+- `[("is_company", "=", False)]` : Restrict company contacts to be added as follower (to avoid emails to info@ email address)
+- `[("user_ids","!=",False)]` : Restrict to contacts with user (internal and portal)
+- `[("employee_ids","!=",False)]` : Restrict to employees
Note: This module won't change existing followers!
diff --git a/mail_restrict_follower_selection/static/description/index.html b/mail_restrict_follower_selection/static/description/index.html
index 8d23fde53..caee439df 100644
--- a/mail_restrict_follower_selection/static/description/index.html
+++ b/mail_restrict_follower_selection/static/description/index.html
@@ -398,9 +398,16 @@
certain record type (or have different restrictions for different record
types), create a parameter
mail_restrict_follower_selection.domain.$your_model.
-As an example, you could use [(‘category_id.name’, ‘=’, ‘Employees’)] to
-allow only contacts with ‘Employees’ tag to be added as follower - this
-also is the default.
+Some examples:
+
+- [("category_id.name", "=", "Employees")] : Only allow contacts
+with ‘Employees’ tag
+- [("is_company", "=", False)] : Restrict company contacts to be
+added as follower (to avoid emails to info@ email address)
+- [("user_ids","!=",False)] : Restrict to contacts with user
+(internal and portal)
+- [("employee_ids","!=",False)] : Restrict to employees
+
Note: This module won’t change existing followers!
From b91377b8491b898fe90a7e2d2fab389e56d5ddb2 Mon Sep 17 00:00:00 2001
From: oca-ci
Date: Thu, 12 Feb 2026 09:06:36 +0000
Subject: [PATCH 19/44] [UPD] Update mail_restrict_follower_selection.pot
---
.../i18n/mail_restrict_follower_selection.pot | 32 +++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/mail_restrict_follower_selection/i18n/mail_restrict_follower_selection.pot b/mail_restrict_follower_selection/i18n/mail_restrict_follower_selection.pot
index 38aaa874c..da8b60b9b 100644
--- a/mail_restrict_follower_selection/i18n/mail_restrict_follower_selection.pot
+++ b/mail_restrict_follower_selection/i18n/mail_restrict_follower_selection.pot
@@ -28,6 +28,38 @@ msgstr ""
msgid "Email Thread"
msgstr ""
+#. module: mail_restrict_follower_selection
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_account_account__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_account_analytic_account__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_account_bank_statement_line__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_account_journal__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_account_move__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_account_payment__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_account_reconcile_model__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_account_setup_bank_manual_config__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_account_tax__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_calendar_event__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_discuss_channel__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_mail_blacklist__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_mail_thread__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_mail_thread_blacklist__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_mail_thread_cc__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_mail_thread_main_attachment__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_mail_thread_phone__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_mailing_contact__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_mailing_mailing__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_phone_blacklist__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_product_category__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_product_pricelist__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_product_product__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_product_template__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_res_company__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_res_partner__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_res_partner_bank__message_partner_ids
+#: model:ir.model.fields,field_description:mail_restrict_follower_selection.field_res_users__message_partner_ids
+msgid "Followers (Partners)"
+msgstr ""
+
#. module: mail_restrict_follower_selection
#: model:ir.model,name:mail_restrict_follower_selection.model_mail_wizard_invite
msgid "Invite wizard"
From ecc6e91e0ce9ac128d7c1eb64374cbfb4f69afb0 Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Thu, 12 Feb 2026 09:10:42 +0000
Subject: [PATCH 20/44] [BOT] post-merge updates
---
README.md | 2 +-
mail_restrict_follower_selection/README.rst | 32 +++++++++++--------
.../__manifest__.py | 2 +-
.../static/description/index.html | 28 +++++++++-------
4 files changed, 37 insertions(+), 27 deletions(-)
diff --git a/README.md b/README.md
index 52228a49b..f4f4bdd56 100644
--- a/README.md
+++ b/README.md
@@ -48,7 +48,7 @@ addon | version | maintainers | summary
[mail_partner_opt_out](mail_partner_opt_out/) | 18.0.1.0.0 | | Add the partner's email to the blackmailed list
[mail_post_defer](mail_post_defer/) | 18.0.1.0.0 |
| Faster and cancellable outgoing messages
[mail_quoted_reply](mail_quoted_reply/) | 18.0.1.0.0 | | Make a reply using a message
-[mail_restrict_follower_selection](mail_restrict_follower_selection/) | 18.0.1.0.0 | | Define a domain from which followers can be selected
+[mail_restrict_follower_selection](mail_restrict_follower_selection/) | 18.0.1.1.0 | | Define a domain from which followers can be selected
[mail_send_confirmation](mail_send_confirmation/) | 18.0.1.0.0 | | Mail Send Confirmation
[mail_show_follower](mail_show_follower/) | 18.0.1.0.2 |
| Show CC document followers in mails.
[mail_suggested_recipient_unchecked](mail_suggested_recipient_unchecked/) | 18.0.1.0.0 |
| Mail suggested recipient unchecked
diff --git a/mail_restrict_follower_selection/README.rst b/mail_restrict_follower_selection/README.rst
index de7c3686b..37ffb0653 100644
--- a/mail_restrict_follower_selection/README.rst
+++ b/mail_restrict_follower_selection/README.rst
@@ -1,3 +1,7 @@
+.. image:: https://odoo-community.org/readme-banner-image
+ :target: https://odoo-community.org/get-involved?utm_source=readme
+ :alt: Odoo Community Association
+
===========================
Restrict follower selection
===========================
@@ -7,13 +11,13 @@ Restrict follower selection
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:449f3de313fb200f336c9351687009ffc0cd603dc47d5d0d4e2d315eb280ebf4
+ !! source digest: sha256:976e9e65a681e7157cb433ca47a19013011496fa891bf180c564616589f0d470
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
-.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
+.. |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
@@ -54,13 +58,13 @@ mail_restrict_follower_selection.domain.$your_model.
Some examples:
-- ``[("category_id.name", "=", "Employees")]`` : Only allow contacts
- with 'Employees' tag
-- ``[("is_company", "=", False)]`` : Restrict company contacts to be
- added as follower (to avoid emails to info@ email address)
-- ``[("user_ids","!=",False)]`` : Restrict to contacts with user
- (internal and portal)
-- ``[("employee_ids","!=",False)]`` : Restrict to employees
+- ``[("category_id.name", "=", "Employees")]`` : Only allow contacts
+ with 'Employees' tag
+- ``[("is_company", "=", False)]`` : Restrict company contacts to be
+ added as follower (to avoid emails to info@ email address)
+- ``[("user_ids","!=",False)]`` : Restrict to contacts with user
+ (internal and portal)
+- ``[("employee_ids","!=",False)]`` : Restrict to employees
Note: This module won't change existing followers!
@@ -86,12 +90,12 @@ Authors
Contributors
------------
-- Holger Brunn
-- Nguyen Tan Phuc
-- Enric Tobella
-- `Quartile `__:
+- Holger Brunn
+- Nguyen Tan Phuc
+- Enric Tobella
+- `Quartile `__:
- - Aung Ko Ko Lin
+ - Aung Ko Ko Lin
Maintainers
-----------
diff --git a/mail_restrict_follower_selection/__manifest__.py b/mail_restrict_follower_selection/__manifest__.py
index 632722209..c31f31f6c 100644
--- a/mail_restrict_follower_selection/__manifest__.py
+++ b/mail_restrict_follower_selection/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "Restrict follower selection",
- "version": "18.0.1.0.0",
+ "version": "18.0.1.1.0",
"author": "Therp BV,Creu Blanca,Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Social Network",
diff --git a/mail_restrict_follower_selection/static/description/index.html b/mail_restrict_follower_selection/static/description/index.html
index caee439df..e4d340ef2 100644
--- a/mail_restrict_follower_selection/static/description/index.html
+++ b/mail_restrict_follower_selection/static/description/index.html
@@ -3,7 +3,7 @@
-Restrict follower selection
+README.rst
-
-
Restrict follower selection
+
+
+
+
+
+
-
+
To configure this module, you need to go to System parameters and adjust
mail_restrict_follower_selection.domain as you see fit. This restricts
followers globally, if you want to restrict only the followers for a
@@ -411,7 +416,7 @@
Note: This module won’t change existing followers!
-
+
Bugs are tracked on GitHub 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
@@ -419,16 +424,16 @@
Do not contact contributors directly about support or help with technical issues.
+