diff --git a/mail_optional_follower_notification/README.rst b/mail_optional_follower_notification/README.rst index 0b0178f29..b18faf824 100644 --- a/mail_optional_follower_notification/README.rst +++ b/mail_optional_follower_notification/README.rst @@ -51,6 +51,9 @@ This field it's initialized to true to keep the standard behavior. .. figure:: https://raw.githubusercontent.com/OCA/social/16.0/mail_optional_follower_notification/static/description/optional_follower_002.png :alt: Checkbox to avoid to notify automatically followers +.. figure:: https://raw.githubusercontent.com/OCA/social/16.0/mail_optional_follower_notification/static/description/optional_follower_003.png + :alt: Checkbox to set the default for the wizard + Bug Tracker =========== @@ -76,6 +79,7 @@ Contributors * Laurent Mignon * Andrea Stirpe * Robin Goots +* Quan Nguyen Maintainers ~~~~~~~~~~~ diff --git a/mail_optional_follower_notification/__manifest__.py b/mail_optional_follower_notification/__manifest__.py index c7a0e7eab..a17198e44 100644 --- a/mail_optional_follower_notification/__manifest__.py +++ b/mail_optional_follower_notification/__manifest__.py @@ -9,5 +9,8 @@ "version": "16.0.1.0.1", "license": "AGPL-3", "depends": ["mail"], - "data": ["wizard/mail_compose_message_view.xml"], + "data": [ + "views/res_config_settings_view.xml", + "wizard/mail_compose_message_view.xml", + ], } diff --git a/mail_optional_follower_notification/models/__init__.py b/mail_optional_follower_notification/models/__init__.py index b70a9f2d0..f624e45b4 100644 --- a/mail_optional_follower_notification/models/__init__.py +++ b/mail_optional_follower_notification/models/__init__.py @@ -1 +1,3 @@ from . import mail_thread +from . import res_company +from . import res_config_settings diff --git a/mail_optional_follower_notification/models/res_company.py b/mail_optional_follower_notification/models/res_company.py new file mode 100644 index 000000000..65d16edb2 --- /dev/null +++ b/mail_optional_follower_notification/models/res_company.py @@ -0,0 +1,7 @@ +from odoo import fields, models + + +class ResCompany(models.Model): + _inherit = "res.company" + + notify_followers = fields.Boolean(default=True) diff --git a/mail_optional_follower_notification/models/res_config_settings.py b/mail_optional_follower_notification/models/res_config_settings.py new file mode 100644 index 000000000..b10838299 --- /dev/null +++ b/mail_optional_follower_notification/models/res_config_settings.py @@ -0,0 +1,10 @@ +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + notify_followers = fields.Boolean( + related="company_id.notify_followers", + readonly=False, + ) diff --git a/mail_optional_follower_notification/readme/CONTRIBUTORS.rst b/mail_optional_follower_notification/readme/CONTRIBUTORS.rst index 7b5c64dfd..dce321eaf 100644 --- a/mail_optional_follower_notification/readme/CONTRIBUTORS.rst +++ b/mail_optional_follower_notification/readme/CONTRIBUTORS.rst @@ -2,3 +2,4 @@ * Laurent Mignon * Andrea Stirpe * Robin Goots +* Quan Nguyen diff --git a/mail_optional_follower_notification/readme/USAGE.rst b/mail_optional_follower_notification/readme/USAGE.rst index bf0bbb3db..a7981e418 100644 --- a/mail_optional_follower_notification/readme/USAGE.rst +++ b/mail_optional_follower_notification/readme/USAGE.rst @@ -8,3 +8,6 @@ This field it's initialized to true to keep the standard behavior. .. figure:: static/description/optional_follower_002.png :alt: Checkbox to avoid to notify automatically followers + +.. figure:: static/description/optional_follower_003.png + :alt: Checkbox to set the default for the wizard diff --git a/mail_optional_follower_notification/static/description/index.html b/mail_optional_follower_notification/static/description/index.html index b83ef301b..de2f656ec 100644 --- a/mail_optional_follower_notification/static/description/index.html +++ b/mail_optional_follower_notification/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code { margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.option { span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -397,6 +397,9 @@ document and” on mail.compose.message:

Checkbox to avoid to notify automatically followers
+
+Checkbox to set the default for the wizard +

Bug Tracker

@@ -421,12 +424,15 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
  • Laurent Mignon <laurent.mignon@acsone.eu>
  • Andrea Stirpe <a.stirpe@onestein.nl>
  • Robin Goots <robin.goots@dynapps.be>
  • +
  • Quan Nguyen <quan.nhm@komit-consulting.com>
  • Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +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.

    diff --git a/mail_optional_follower_notification/static/description/optional_follower_003.png b/mail_optional_follower_notification/static/description/optional_follower_003.png new file mode 100644 index 000000000..c300f2789 Binary files /dev/null and b/mail_optional_follower_notification/static/description/optional_follower_003.png differ diff --git a/mail_optional_follower_notification/views/res_config_settings_view.xml b/mail_optional_follower_notification/views/res_config_settings_view.xml new file mode 100644 index 000000000..dba75107a --- /dev/null +++ b/mail_optional_follower_notification/views/res_config_settings_view.xml @@ -0,0 +1,23 @@ + + + res.config.settings.view.form.inherit.mail + res.config.settings + + + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    diff --git a/mail_optional_follower_notification/wizard/mail_compose_message.py b/mail_optional_follower_notification/wizard/mail_compose_message.py index 0cd83ec37..6ee12acd8 100644 --- a/mail_optional_follower_notification/wizard/mail_compose_message.py +++ b/mail_optional_follower_notification/wizard/mail_compose_message.py @@ -7,7 +7,9 @@ from odoo import fields, models class MailComposeMessage(models.TransientModel): _inherit = "mail.compose.message" - notify_followers = fields.Boolean(default=True) + notify_followers = fields.Boolean( + default=lambda self: self.env.company.notify_followers + ) def _action_send_mail(self, auto_commit=False): result_mails_su, result_messages = (