From fd6d4916fce25a0d155248e76a99f2a32390cd23 Mon Sep 17 00:00:00 2001 From: Kristof Bernaert Date: Sun, 1 Feb 2026 18:33:09 +0100 Subject: [PATCH] correct problem for sending invoice emails --- .../models/account_move.py | 17 ----------------- .../models/account_move_send.py | 8 ++++---- 2 files changed, 4 insertions(+), 21 deletions(-) delete mode 100755 allow_mail_archived_partner/models/account_move.py diff --git a/allow_mail_archived_partner/models/account_move.py b/allow_mail_archived_partner/models/account_move.py deleted file mode 100755 index ca13675..0000000 --- a/allow_mail_archived_partner/models/account_move.py +++ /dev/null @@ -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() diff --git a/allow_mail_archived_partner/models/account_move_send.py b/allow_mail_archived_partner/models/account_move_send.py index 1c02848..334a1ca 100755 --- a/allow_mail_archived_partner/models/account_move_send.py +++ b/allow_mail_archived_partner/models/account_move_send.py @@ -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,