Skip to content

Commit

Permalink
Merge PR #1424 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Jul 29, 2024
2 parents 1db5398 + bb96e92 commit 6ac69ab
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 7 deletions.
4 changes: 4 additions & 0 deletions mail_optional_follower_notification/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ This field it's initialized to true to keep the standard behavior.
.. figure:: https://raw.githubusercontent.com/OCA/social/14.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/14.0/mail_optional_follower_notification/static/description/optional_follower_003.png
:alt: Checkbox to set the default for the wizard

Bug Tracker
===========

Expand All @@ -75,6 +78,7 @@ Contributors
* Adrien Peiffer <[email protected]>
* Laurent Mignon <[email protected]>
* Andrea Stirpe <[email protected]>
* Quan Nguyen <[email protected]>

Maintainers
~~~~~~~~~~~
Expand Down
5 changes: 4 additions & 1 deletion mail_optional_follower_notification/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
"version": "14.0.1.0.0",
"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",
],
}
2 changes: 2 additions & 0 deletions mail_optional_follower_notification/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from . import mail_thread
from . import res_company
from . import res_config_settings
7 changes: 7 additions & 0 deletions mail_optional_follower_notification/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from odoo import fields, models


class ResCompany(models.Model):
_inherit = "res.company"

notify_followers = fields.Boolean(default=True)
10 changes: 10 additions & 0 deletions mail_optional_follower_notification/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -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,
)
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Adrien Peiffer <[email protected]>
* Laurent Mignon <[email protected]>
* Andrea Stirpe <[email protected]>
* Quan Nguyen <[email protected]>
3 changes: 3 additions & 0 deletions mail_optional_follower_notification/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 11 additions & 5 deletions mail_optional_follower_notification/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -9,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
: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.
Expand Down Expand Up @@ -275,7 +275,7 @@
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 }
Expand All @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -397,6 +397,9 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<div class="figure">
<img alt="Checkbox to avoid to notify automatically followers" src="https://raw.githubusercontent.com/OCA/social/14.0/mail_optional_follower_notification/static/description/optional_follower_002.png" />
</div>
<div class="figure">
<img alt="Checkbox to set the default for the wizard" src="https://raw.githubusercontent.com/OCA/social/14.0/mail_optional_follower_notification/static/description/optional_follower_003.png" />
</div>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
Expand All @@ -420,12 +423,15 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li>Adrien Peiffer &lt;<a class="reference external" href="mailto:adrien.peiffer&#64;acsone.eu">adrien.peiffer&#64;acsone.eu</a>&gt;</li>
<li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;</li>
<li>Andrea Stirpe &lt;<a class="reference external" href="mailto:a.stirpe&#64;onestein.nl">a.stirpe&#64;onestein.nl</a>&gt;</li>
<li>Quan Nguyen &lt;<a class="reference external" href="mailto:quan.nhm&#64;komit-consulting.com">quan.nhm&#64;komit-consulting.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.mail</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="100" />
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='emails']" position="inside">
<div class="col-12 col-lg-6 o_setting_box" id="notify_followers">
<div class="o_setting_left_pane">
<field name="notify_followers" />
</div>
<div class="o_setting_right_pane">
<label for="notify_followers" />
<div class="text-muted">
Default notify followers when the user sending email
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
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 send_mail(self, auto_commit=False):
for wizard in self:
Expand Down

0 comments on commit 6ac69ab

Please sign in to comment.