diff --git a/web_send_message_popup/README.rst b/web_send_message_popup/README.rst
index aa2ab529c..0d1f056ef 100644
--- a/web_send_message_popup/README.rst
+++ b/web_send_message_popup/README.rst
@@ -7,7 +7,7 @@ Web Send Message as Popup
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:50f258f27e9b4cb2814665022c686779f90653dbf0854d3f04b498cdf6819d60
+ !! source digest: sha256:0083ff4f27d544631c17fd7354b1243d92d296ca3a3a9f61b183e739ec6e8346
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,13 +17,13 @@ Web Send Message as Popup
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
- :target: https://github.com/OCA/web/tree/15.0/web_send_message_popup
+ :target: https://github.com/OCA/web/tree/16.0/web_send_message_popup
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/web-15-0/web-15-0-web_send_message_popup
+ :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_send_message_popup
: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/web&target_branch=15.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -48,7 +48,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.
@@ -83,6 +83,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/web `_ project on GitHub.
+This module is part of the `OCA/web `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/web_send_message_popup/__manifest__.py b/web_send_message_popup/__manifest__.py
index 485fc1706..934c6733f 100644
--- a/web_send_message_popup/__manifest__.py
+++ b/web_send_message_popup/__manifest__.py
@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://gnu.org/licenses/agpl).
{
"name": "Web Send Message as Popup",
- "version": "15.0.1.0.0",
+ "version": "16.0.1.0.0",
"author": "Camptocamp, Odoo Community Association (OCA)",
"maintainer": "Camptocamp",
"license": "AGPL-3",
diff --git a/web_send_message_popup/static/description/index.html b/web_send_message_popup/static/description/index.html
index ac55aba77..88b65124c 100644
--- a/web_send_message_popup/static/description/index.html
+++ b/web_send_message_popup/static/description/index.html
@@ -367,9 +367,9 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:50f258f27e9b4cb2814665022c686779f90653dbf0854d3f04b498cdf6819d60
+!! source digest: sha256:0083ff4f27d544631c17fd7354b1243d92d296ca3a3a9f61b183e739ec6e8346
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

In the email/notes threads below the form views, the link ‘Send a
message’ unfold a text field. From there, a button allows to open the
text field in a full featured email popup with the subject, templates,
@@ -394,7 +394,7 @@ if the popup is always wanted.
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.
@@ -423,7 +423,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
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/web project on GitHub.
+
This module is part of the OCA/web project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/web_send_message_popup/static/src/models/chatter/chatter.esm.js b/web_send_message_popup/static/src/models/chatter/chatter.esm.js
index f3b8607bb..748afc110 100644
--- a/web_send_message_popup/static/src/models/chatter/chatter.esm.js
+++ b/web_send_message_popup/static/src/models/chatter/chatter.esm.js
@@ -2,56 +2,61 @@
import {clear} from "@mail/model/model_field_command";
import {escapeAndCompactTextContent} from "@mail/js/utils";
-import {registerInstancePatchModel} from "@mail/model/model_core";
+import {registerPatch} from "@mail/model/model_core";
-registerInstancePatchModel("mail.chatter", "web_send_message_popup.ChatterPatch", {
- onClickSendMessage() {
- if (this.composerView) {
- // Change `isLog` to false since this should only be possible when you press
- // "Log Note" first, otherwise this won't hurt.
- this.composerView.composer.update({isLog: false});
- // Open the full composer with `composerView` because it carries through the
- // composer options.
- this.composerView.openFullComposer();
- // Clear the `composerView` since we don't need it no more.
- this.update({composerView: clear()});
- return;
- }
- this.openFullComposer();
- },
- openFullComposer() {
- // Rough copy of composer view function `openFullComposer`.
- // Get composer from thread.
- // We access data from the composer since history still is saved there.
- // e.g. open and close "Log note".
- const composer = this.thread.composer;
- const context = {
- default_attachment_ids: composer.attachments.map((att) => att.id),
- default_body: escapeAndCompactTextContent(composer.textInputContent),
- default_is_log: false,
- default_model: this.threadModel,
- default_partner_ids: composer.recipients.map((partner) => partner.id),
- default_res_id: this.threadId,
- mail_post_autofollow: true,
- };
- const action = {
- type: "ir.actions.act_window",
- res_model: "mail.compose.message",
- view_mode: "form",
- views: [[false, "form"]],
- target: "new",
- context,
- };
- const options = {
- on_close: () => {
- if (composer.exists()) {
- composer._reset();
- if (composer.activeThread) {
- composer.activeThread.loadNewMessages();
+registerPatch({
+ name: "Chatter",
+ recordMethods: {
+ // Fn overwrite
+ onClickSendMessage() {
+ if (this.composerView) {
+ // Change `isLog` to false since this should only be possible when you
+ // press "Log Note" first, otherwise this won't hurt.
+ this.composerView.composer.update({isLog: false});
+ // Open the full composer with `composerView` because it carries through
+ // the composer options.
+ this.composerView.openFullComposer();
+ // Clear the `composerView` since we don't need it no more.
+ this.update({composerView: clear()});
+ return;
+ }
+ this.openFullComposer();
+ },
+ async openFullComposer() {
+ // Rough copy of composer view function `openFullComposer`.
+ // Get composer from thread.
+ // We access data from the composer since history still is saved there.
+ // e.g. open and close "Log note".
+ const composer = this.thread.composer;
+ const context = {
+ default_attachment_ids: composer.attachments.map((att) => att.id),
+ default_body: escapeAndCompactTextContent(composer.textInputContent),
+ default_is_log: false,
+ default_model: this.threadModel,
+ default_partner_ids: composer.recipients.map((partner) => partner.id),
+ default_res_id: this.threadId,
+ mail_post_autofollow: this.thread.hasWriteAccess,
+ };
+ const action = {
+ type: "ir.actions.act_window",
+ name: this.env._t("Compose Email"),
+ res_model: "mail.compose.message",
+ view_mode: "form",
+ views: [[false, "form"]],
+ target: "new",
+ context,
+ };
+ const options = {
+ on_close: () => {
+ if (composer.exists()) {
+ composer._reset();
+ if (composer.activeThread) {
+ composer.activeThread.fetchData(["messages"]);
+ }
}
- }
- },
- };
- this.env.bus.trigger("do-action", {action, options});
+ },
+ };
+ await this.env.services.action.doAction(action, options);
+ },
},
});