You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
1014 B

# -*- 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'
@api.model
def default_get(self, fields_list):
res = super(MailComposeMessage, self).default_get(fields_list)
res.setdefault(
'autofollow_recipients',
self.env.context.get('mail_post_autofollow', False))
return res
autofollow_recipients = fields.Boolean(
string='Make recipients followers',
help="""if checked, the additional recipients will be added as\
followers on the related object""")
@api.multi
def send_mail(self):
for wizard in self:
super(MailComposeMessage, wizard.with_context(
mail_post_autofollow=wizard.autofollow_recipients)).send_mail()
return {'type': 'ir.actions.act_window_close'}