correct problem for sending invoice emails

This commit is contained in:
Kristof Bernaert
2026-02-01 18:33:09 +01:00
parent 80872e4660
commit fd6d4916fc
2 changed files with 4 additions and 21 deletions
@@ -1,17 +0,0 @@
import logging
_logger = logging.getLogger(__name__)
from odoo import models
class AccountMove(models.Model):
_inherit = "account.move"
def action_invoice_sent(self):
_logger.error("🔥🔥🔥 HIT action_invoice_sent 🔥🔥🔥")
return super().action_invoice_sent()
def action_invoice_send(self):
_logger.error("🔥🔥🔥 HIT action_invoice_send 🔥🔥🔥")
return super().action_invoice_send()
@@ -1,14 +1,15 @@
def action_send_and_print(self):
# _logger.error("🔥 ACCOUNT.INVOICE.SEND action_send_and_print CALLED")
# _logger.error("🔥 Wizard partner_ids: %s", self.partner_ids.ids)
_logger.error("🔥 ACCOUNT.INVOICE.SEND action_send_and_print CALLED")
_logger.error("🔥 Wizard partner_ids: %s", self.partner_ids.ids)
ctx = dict(self.env.context)
if self.partner_ids:
ctx.update(
{
# 🔥 THIS is what mail.compose.message actually reads
# 🔥 REQUIRED: otherwise archived partners are dropped
"default_partner_ids": [(6, 0, self.partner_ids.ids)],
"active_test": False,
}
)
@@ -16,7 +17,6 @@ def action_send_and_print(self):
AccountInvoiceSend,
self.with_context(
ctx,
active_test=False,
include_archived_partners=True,
mail_notify_force=True,
force_email=True,