mirror of https://github.com/OCA/social.git
[IMP] mail_optional_follower_notification: default notify followers
Add a settings to set a default for the boolean 'Notifiy Followers' in the wizardpull/1584/head
parent
318804e296
commit
ddf3be8e7a
|
@ -49,8 +49,11 @@ This field it's initialized to true to keep the standard behavior.
|
|||
|
||||
|image2|
|
||||
|
||||
|image3|
|
||||
|
||||
.. |image1| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_optional_follower_notification/static/description/optional_follower_001.png
|
||||
.. |image2| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_optional_follower_notification/static/description/optional_follower_002.png
|
||||
.. |image3| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_optional_follower_notification/static/description/optional_follower_003.png
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
@ -77,6 +80,7 @@ Contributors
|
|||
- 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
|
||||
-----------
|
||||
|
|
|
@ -9,5 +9,8 @@
|
|||
"version": "17.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",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
from . import mail_thread
|
||||
from . import res_company
|
||||
from . import res_config_settings
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = "res.company"
|
||||
|
||||
notify_followers = fields.Boolean(default=True)
|
|
@ -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,
|
||||
)
|
|
@ -2,3 +2,4 @@
|
|||
- 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>
|
||||
|
|
|
@ -6,3 +6,5 @@ This field it's initialized to true to keep the standard behavior.
|
|||

|
||||
|
||||

|
||||
|
||||

|
||||
|
|
|
@ -393,6 +393,7 @@ document and” on mail.compose.message:</p>
|
|||
<p>This field it’s initialized to true to keep the standard behavior.</p>
|
||||
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/social/17.0/mail_optional_follower_notification/static/description/optional_follower_001.png" /></p>
|
||||
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/social/17.0/mail_optional_follower_notification/static/description/optional_follower_002.png" /></p>
|
||||
<p><img alt="image3" src="https://raw.githubusercontent.com/OCA/social/17.0/mail_optional_follower_notification/static/description/optional_follower_003.png" /></p>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
|
||||
|
@ -417,6 +418,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|||
<li>Laurent Mignon <<a class="reference external" href="mailto:laurent.mignon@acsone.eu">laurent.mignon@acsone.eu</a>></li>
|
||||
<li>Andrea Stirpe <<a class="reference external" href="mailto:a.stirpe@onestein.nl">a.stirpe@onestein.nl</a>></li>
|
||||
<li>Robin Goots <<a class="reference external" href="mailto:robin.goots@dynapps.be">robin.goots@dynapps.be</a>></li>
|
||||
<li>Quan Nguyen <a class="reference external" href="mailto:quan.nhm@komit-consulting.com">quan.nhm@komit-consulting.com</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 78 KiB |
|
@ -0,0 +1,15 @@
|
|||
<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="mail.res_config_settings_view_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//block[@id='emails']" position="inside">
|
||||
<setting help="Default notify followers when the user sending email">
|
||||
<field name="notify_followers" />
|
||||
</setting>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
|
@ -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 = (
|
||||
|
|
Loading…
Reference in New Issue