2016-05-25 16:03:38 +02:00
|
|
|
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
|
2019-11-29 16:01:16 +01:00
|
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
2016-05-25 16:03:38 +02:00
|
|
|
|
2016-10-24 11:46:07 +02:00
|
|
|
from odoo import models, fields, api
|
2016-05-25 16:03:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
class MailComposeMessage(models.TransientModel):
|
|
|
|
_inherit = 'mail.compose.message'
|
|
|
|
|
|
|
|
notify_followers = fields.Boolean(default=True)
|
|
|
|
|
|
|
|
@api.multi
|
2016-08-19 09:40:09 +02:00
|
|
|
def send_mail(self, auto_commit=False):
|
2019-11-29 16:01:16 +01:00
|
|
|
ctx = self.env.context.copy()
|
2016-05-25 16:03:38 +02:00
|
|
|
for wizard in self:
|
2019-11-29 16:01:16 +01:00
|
|
|
ctx['notify_followers'] = wizard.notify_followers
|
|
|
|
wizard = wizard.with_context(ctx)
|
2016-08-19 09:40:09 +02:00
|
|
|
super(MailComposeMessage, wizard).send_mail(
|
|
|
|
auto_commit=auto_commit)
|
2016-05-25 16:03:38 +02:00
|
|
|
return {'type': 'ir.actions.act_window_close'}
|