Steps to repoduce: - Accounting > Customers > Invoices: select several invoices to send - Action > Send & Print > (deselect Print) > Send & Print Issue: - It sends only one invoice per company Cause: - the mail_compose_message sets the status of an email as `cancel` when a mail has already been sent to a specific adress mail in the batch Solution: - If the use of mass mailing is document-based (e.g.: sending multiple invoices) it will allow to send multiple emails to the same adress opw-2775121 closes odoo/odoo#88992 X-original-commit: f08685020f6a00d4e10e30ccbcf70c9eb1a764d5 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
16 lines
636 B
Python
16 lines
636 B
Python
# -*- coding: utf-8 -*-
|
|
# purches Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models
|
|
|
|
|
|
class MailComposeMessage(models.TransientModel):
|
|
_inherit = 'mail.compose.message'
|
|
|
|
def _action_send_mail(self, auto_commit=False):
|
|
if self.model == 'purchase.order':
|
|
self = self.with_context(mailing_document_based=True)
|
|
if self.env.context.get('mark_rfq_as_sent'):
|
|
self = self.with_context(mail_notify_author=self.env.user.partner_id in self.partner_ids)
|
|
return super(MailComposeMessage, self)._action_send_mail(auto_commit=auto_commit)
|