diff --git a/mail_send_confirmation/README.rst b/mail_send_confirmation/README.rst new file mode 100644 index 000000000..60942e5ca --- /dev/null +++ b/mail_send_confirmation/README.rst @@ -0,0 +1,93 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +====================== +Mail Send Confirmation +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:21add3e275a98653957d9e7daab0231071242255507af31cfbddb988e2a2b28f + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github + :target: https://github.com/OCA/mail/tree/19.0/mail_send_confirmation + :alt: OCA/mail +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/mail-19-0/mail-19-0-mail_send_confirmation + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module asks for confirmation when 'Send' button in the message +composer is pressed, to reduce the chances of accidentally sending an +internal message to the external followers. + +**Table of contents** + +.. contents:: + :local: + +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 +------- + +* Quartile Limited + +Contributors +------------ + +- `Quartile `__: + + - Aung Ko Ko Lin + +- `360ERP `__: + + - Andrea Stirpe + - Kevin Khao + +- `CorporateHub `__ + + - Alexey Pelykh + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/mail `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_send_confirmation/__init__.py b/mail_send_confirmation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/mail_send_confirmation/__manifest__.py b/mail_send_confirmation/__manifest__.py new file mode 100644 index 000000000..03e78774f --- /dev/null +++ b/mail_send_confirmation/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2023 Quartile (https://www.quartile.co) +# Copyright 2025 CorporateHub +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Mail Send Confirmation", + "version": "19.0.1.0.0", + "author": "Quartile Limited, Odoo Community Association (OCA)", + "license": "AGPL-3", + "category": "Mail", + "website": "https://github.com/OCA/mail", + "depends": ["mail"], + "assets": { + "web.assets_backend": [ + "mail_send_confirmation/static/src/models/composer_view.esm.js", + ], + }, + "data": [ + "views/mail_compose_message.xml", + ], + "installable": True, +} diff --git a/mail_send_confirmation/i18n/es.po b/mail_send_confirmation/i18n/es.po new file mode 100644 index 000000000..0aef3a7e5 --- /dev/null +++ b/mail_send_confirmation/i18n/es.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_send_confirmation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-01-09 20:34+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: mail_send_confirmation +#. odoo-javascript +#: code:addons/mail_send_confirmation/static/src/models/composer_view.esm.js:0 +#, python-format +msgid "Confirm" +msgstr "Confirmar" + +#. module: mail_send_confirmation +#. odoo-javascript +#: code:addons/mail_send_confirmation/static/src/models/composer_view.esm.js:0 +#, python-format +msgid "Confirmation" +msgstr "Confirmación" + +#. module: mail_send_confirmation +#. odoo-javascript +#: code:addons/mail_send_confirmation/static/src/models/composer_view.esm.js:0 +#, python-format +msgid "Discard" +msgstr "Descartar" + +#. module: mail_send_confirmation +#. odoo-javascript +#: code:addons/mail_send_confirmation/static/src/models/composer_view.esm.js:0 +#, python-format +msgid "" +"This message will be sent to external partners as well. Are you sure you " +"would like to send this message?" +msgstr "" +"Este mensaje también se enviará a socios externos. ¿Está seguro de que desea " +"enviar este mensaje?" diff --git a/mail_send_confirmation/i18n/it.po b/mail_send_confirmation/i18n/it.po new file mode 100644 index 000000000..750912626 --- /dev/null +++ b/mail_send_confirmation/i18n/it.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_send_confirmation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-01-03 11:36+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 4.17\n" + +#. module: mail_send_confirmation +#. odoo-javascript +#: code:addons/mail_send_confirmation/static/src/models/composer_view.esm.js:0 +#, python-format +msgid "Confirm" +msgstr "Conferma" + +#. module: mail_send_confirmation +#. odoo-javascript +#: code:addons/mail_send_confirmation/static/src/models/composer_view.esm.js:0 +#, python-format +msgid "Confirmation" +msgstr "Conferma" + +#. module: mail_send_confirmation +#. odoo-javascript +#: code:addons/mail_send_confirmation/static/src/models/composer_view.esm.js:0 +#, python-format +msgid "Discard" +msgstr "Abbandona" + +#. module: mail_send_confirmation +#. odoo-javascript +#: code:addons/mail_send_confirmation/static/src/models/composer_view.esm.js:0 +#, python-format +msgid "" +"This message will be sent to external partners as well. Are you sure you " +"would like to send this message?" +msgstr "" +"Questo messaggio verrà inviato anche ai partner. Si è sicuri di inviare " +"questo messaggio?" diff --git a/mail_send_confirmation/i18n/mail_send_confirmation.pot b/mail_send_confirmation/i18n/mail_send_confirmation.pot new file mode 100644 index 000000000..cfd4717e2 --- /dev/null +++ b/mail_send_confirmation/i18n/mail_send_confirmation.pot @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_send_confirmation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mail_send_confirmation +#. odoo-javascript +#: code:addons/mail_send_confirmation/static/src/models/composer_view.esm.js:0 +msgid "" +"This message will be sent to external partners as well. Are you sure you " +"would like to send this message?" +msgstr "" diff --git a/mail_send_confirmation/pyproject.toml b/mail_send_confirmation/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/mail_send_confirmation/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/mail_send_confirmation/readme/CONTRIBUTORS.md b/mail_send_confirmation/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..054db9871 --- /dev/null +++ b/mail_send_confirmation/readme/CONTRIBUTORS.md @@ -0,0 +1,7 @@ +- [Quartile](https://www.quartile.co): + - Aung Ko Ko Lin +- [360ERP](https://www.360erp.com): + - Andrea Stirpe + - Kevin Khao +- [CorporateHub](https://corporatehub.eu/) + - Alexey Pelykh \<\> diff --git a/mail_send_confirmation/readme/DESCRIPTION.md b/mail_send_confirmation/readme/DESCRIPTION.md new file mode 100644 index 000000000..6420ffba2 --- /dev/null +++ b/mail_send_confirmation/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module asks for confirmation when 'Send' button in the message +composer is pressed, to reduce the chances of accidentally sending an +internal message to the external followers. diff --git a/mail_send_confirmation/static/description/icon.png b/mail_send_confirmation/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/mail_send_confirmation/static/description/icon.png differ diff --git a/mail_send_confirmation/static/description/index.html b/mail_send_confirmation/static/description/index.html new file mode 100644 index 000000000..39be2f472 --- /dev/null +++ b/mail_send_confirmation/static/description/index.html @@ -0,0 +1,443 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Mail Send Confirmation

+ +

Beta License: AGPL-3 OCA/mail Translate me on Weblate Try me on Runboat

+

This module asks for confirmation when ‘Send’ button in the message +composer is pressed, to reduce the chances of accidentally sending an +internal message to the external followers.

+

Table of contents

+ +
+

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

+
    +
  • Quartile Limited
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/mail project on GitHub.

+

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

+
+
+
+
+ + diff --git a/mail_send_confirmation/static/src/models/composer_view.esm.js b/mail_send_confirmation/static/src/models/composer_view.esm.js new file mode 100644 index 000000000..8fafd6190 --- /dev/null +++ b/mail_send_confirmation/static/src/models/composer_view.esm.js @@ -0,0 +1,34 @@ +/* @odoo-module */ + +import {Composer} from "@mail/core/common/composer"; +import {ConfirmationDialog} from "@web/core/confirmation_dialog/confirmation_dialog"; +import {_t} from "@web/core/l10n/translation"; +import {patch} from "@web/core/utils/patch"; +import {useService} from "@web/core/utils/hooks"; + +patch(Composer.prototype, { + /** + * @override + */ + setup() { + super.setup(); + this.dialogService = useService("dialog"); + }, + async sendMessage() { + if (this.props.type === "message") { + this.dialogService.add(ConfirmationDialog, { + body: _t( + "This message will be sent to external partners as well. Are you sure you would like to send this message?" + ), + confirm: async () => { + super.sendMessage(); + }, + cancel: () => { + /* We need this empty function to display the cancel button */ + }, + }); + } else { + super.sendMessage(); + } + }, +}); diff --git a/mail_send_confirmation/views/mail_compose_message.xml b/mail_send_confirmation/views/mail_compose_message.xml new file mode 100644 index 000000000..65ca31675 --- /dev/null +++ b/mail_send_confirmation/views/mail_compose_message.xml @@ -0,0 +1,15 @@ + + + + mail.compose.message.form + mail.compose.message + + + + This message will be sent to external partners as well. Are you sure you would like to send this message? + + + +