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.

16 lines
526 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2018 Tecnativa - Jairo Llopis
  3. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
  4. from odoo import api, models
  5. class MailComposeMessage(models.TransientModel):
  6. _inherit = "mail.compose.message"
  7. @api.multi
  8. def send_mail(self, auto_commit=False):
  9. """Force auto commit when sending consent emails."""
  10. if self.env.context.get('mark_consent_sent'):
  11. auto_commit = True
  12. return super(MailComposeMessage, self).send_mail(auto_commit)