diff --git a/mail_send_confirmation/README.rst b/mail_send_confirmation/README.rst new file mode 100644 index 0000000000..749d1f2c78 --- /dev/null +++ b/mail_send_confirmation/README.rst @@ -0,0 +1,92 @@ +====================== +Mail Send Confirmation +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d75629616776166c8cabbfb0c38c79325902f4c30b739ee01b4d1559697eae77 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/18.0/mail_send_confirmation + :alt: OCA/social +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/social-18-0/social-18-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/social&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module asks for confirmation when 'Send' button in the message +composer of the chatter is pressed, to reduce the chances of +accidentally sending an internal message to the external followers. + +Limitation +---------- + +As of now, this module does not change the behavior of the full composer +(i.e. no confirmation will be requested), which shows the recipients and +therefore the extra confirmation step may not be as necessary as in the +simple composer. + +**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 + +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_send_confirmation/__init__.py b/mail_send_confirmation/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mail_send_confirmation/__manifest__.py b/mail_send_confirmation/__manifest__.py new file mode 100644 index 0000000000..84347761f9 --- /dev/null +++ b/mail_send_confirmation/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2023 Quartile Limited +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Mail Send Confirmation", + "version": "18.0.1.0.0", + "author": "Quartile Limited, Odoo Community Association (OCA)", + "license": "AGPL-3", + "category": "Mail", + "website": "https://github.com/OCA/social", + "depends": ["mail"], + "assets": { + "web.assets_backend": [ + "mail_send_confirmation/static/src/models/composer_view.esm.js", + ], + }, + "installable": True, +} diff --git a/mail_send_confirmation/i18n/es.po b/mail_send_confirmation/i18n/es.po new file mode 100644 index 0000000000..0aef3a7e55 --- /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 0000000000..7509126268 --- /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 0000000000..54f6646c7d --- /dev/null +++ b/mail_send_confirmation/i18n/mail_send_confirmation.pot @@ -0,0 +1,44 @@ +# 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" +"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 +#, python-format +msgid "Confirm" +msgstr "" + +#. module: mail_send_confirmation +#. odoo-javascript +#: code:addons/mail_send_confirmation/static/src/models/composer_view.esm.js:0 +#, python-format +msgid "Confirmation" +msgstr "" + +#. module: mail_send_confirmation +#. odoo-javascript +#: code:addons/mail_send_confirmation/static/src/models/composer_view.esm.js:0 +#, python-format +msgid "Discard" +msgstr "" + +#. 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 "" diff --git a/mail_send_confirmation/pyproject.toml b/mail_send_confirmation/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /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 0000000000..0caf4e67d8 --- /dev/null +++ b/mail_send_confirmation/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- [Quartile](https://www.quartile.co): + - Aung Ko Ko Lin +- [360ERP](https://www.360erp.com): + - Andrea Stirpe + - Kevin Khao diff --git a/mail_send_confirmation/readme/DESCRIPTION.md b/mail_send_confirmation/readme/DESCRIPTION.md new file mode 100644 index 0000000000..b4a1c05795 --- /dev/null +++ b/mail_send_confirmation/readme/DESCRIPTION.md @@ -0,0 +1,10 @@ +This module asks for confirmation when 'Send' button in the message +composer of the chatter is pressed, to reduce the chances of +accidentally sending an internal message to the external followers. + +## Limitation + +As of now, this module does not change the behavior of the full composer +(i.e. no confirmation will be requested), which shows the recipients and +therefore the extra confirmation step may not be as necessary as in the +simple composer. diff --git a/mail_send_confirmation/static/description/icon.png b/mail_send_confirmation/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 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 0000000000..b51b68b6f2 --- /dev/null +++ b/mail_send_confirmation/static/description/index.html @@ -0,0 +1,434 @@ + + + + + +Mail Send Confirmation + + + +
+

Mail Send Confirmation

+ + +

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

+

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

+
+

Limitation

+

As of now, this module does not change the behavior of the full composer +(i.e. no confirmation will be requested), which shows the recipients and +therefore the extra confirmation step may not be as necessary as in the +simple composer.

+

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.

+
+ +
+
+

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/social 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 0000000000..8fafd6190f --- /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(); + } + }, +});