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.

19 lines
648 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2018 Lorenzo Battistini - Agile Business Group
  3. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
  4. from odoo import models, api
  5. class Message(models.Model):
  6. _inherit = 'mail.message'
  7. @api.model
  8. def create(self, values):
  9. if self.env.user.company_id.force_mail_queue:
  10. mail_notify_force_send = self.env.context.get(
  11. 'mail_notify_force_send', False)
  12. return super(Message, self.with_context(
  13. mail_notify_force_send=mail_notify_force_send)).create(values)
  14. else:
  15. return super(Message, self).create(values)