social/mail_optional_follower_notification/wizard/mail_compose_message.py
Adrien Peiffer (ACSONE) df16371a2e Add mail_optional_follower_notification module (#60)
* [ADD] Add mail_optional_follower_notifications module

* [CHG][mail_optional_follower_notifications] Readme.

* [IMP][mail_optional_follower_notifications] Code review.

* [CHG] Rename mail_optional_follower_notifications to mail_optional_follower_notification

* [IMP][mail_optional_follower_notification] Review
2022-03-09 14:42:46 +01:00

20 lines
609 B
Python

# -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
notify_followers = fields.Boolean(default=True)
@api.multi
def send_mail(self):
for wizard in self:
wizard = wizard.with_context(
notify_followers=wizard.notify_followers)
super(MailComposeMessage, wizard).send_mail()
return {'type': 'ir.actions.act_window_close'}