diff --git a/mail_send_confirmation/README.rst b/mail_send_confirmation/README.rst new file mode 100644 index 0000000000..671c8a573f --- /dev/null +++ b/mail_send_confirmation/README.rst @@ -0,0 +1,84 @@ +====================== +Mail Send Confirmation +====================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_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-15-0/social-15-0-mail_send_confirmation + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/205/15.0 + :alt: Try me on Runbot + +|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 smashing 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 + +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/__manifest__.py b/mail_send_confirmation/__manifest__.py new file mode 100644 index 0000000000..c77f483a2a --- /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": "15.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/components/composer/composer.esm.js", + ], + }, + "installable": True, +} diff --git a/mail_send_confirmation/readme/CONTRIBUTORS.rst b/mail_send_confirmation/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..cd4e44ca98 --- /dev/null +++ b/mail_send_confirmation/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Quartile `__: + + * Aung Ko Ko Lin diff --git a/mail_send_confirmation/readme/DESCRIPTION.rst b/mail_send_confirmation/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..036a58e0b0 --- /dev/null +++ b/mail_send_confirmation/readme/DESCRIPTION.rst @@ -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..96b398e1a9 --- /dev/null +++ b/mail_send_confirmation/static/description/index.html @@ -0,0 +1,425 @@ + + + + + + +Mail Send Confirmation + + + +
+

Mail Send Confirmation

+ + +

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

+

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 smashing 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/components/composer/composer.esm.js b/mail_send_confirmation/static/src/components/composer/composer.esm.js new file mode 100644 index 0000000000..71c21704f5 --- /dev/null +++ b/mail_send_confirmation/static/src/components/composer/composer.esm.js @@ -0,0 +1,52 @@ +/** @odoo-module */ + +import {Composer} from "@mail/components/composer/composer"; +import {patch} from "web.utils"; +import Dialog from "web.Dialog"; +import core from "web.core"; +const _t = core._t; + +patch( + Composer.prototype, + "mail_send_confirmation/static/src/components/composer/composer.js", + { + // -------------------------------------------------------------------------- + // Handlers + // -------------------------------------------------------------------------- + + /** + * Small override that asks for confirmation in case when send mail to customer. + * + * @override + */ + _onClickSend() { + const superMethod = this._super; + if (this.composerView.composer.isLog) { + this._super(); + } else { + this.dialog = new Dialog(this, { + title: _t("Confirmation"), + $content: $("
", { + text: _.str.sprintf( + _t( + "This message will be sent to external partners as well. Are you sure you would like to send this message?" + ) + ), + }), + buttons: [ + { + text: _t("Confirm"), + classes: "btn-primary", + close: true, + click: function () { + superMethod(); + }, + }, + {text: _t("Discard"), close: true}, + ], + }); + this.dialog.open(); + } + }, + } +); diff --git a/setup/mail_send_confirmation/odoo/addons/mail_send_confirmation b/setup/mail_send_confirmation/odoo/addons/mail_send_confirmation new file mode 120000 index 0000000000..5816a390ec --- /dev/null +++ b/setup/mail_send_confirmation/odoo/addons/mail_send_confirmation @@ -0,0 +1 @@ +../../../../mail_send_confirmation \ No newline at end of file diff --git a/setup/mail_send_confirmation/setup.py b/setup/mail_send_confirmation/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/mail_send_confirmation/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)