Fix allow_mail_archived_partner causing system notifications to send emails

This commit is contained in:
Kristof Bernaert
2026-01-26 01:29:24 +01:00
parent 8cafb4a908
commit c5a92d81df
@@ -1,8 +1,8 @@
from odoo import models, api from odoo import models, api
class AccountMoveSendWizard(models.TransientModel): class AccountInvoiceSend(models.TransientModel):
_inherit = "account.move.send.wizard" _inherit = "account.invoice.send"
@api.model @api.model
def _get_default_mail_partner_ids(self, move, mail_template, mail_lang): def _get_default_mail_partner_ids(self, move, mail_template, mail_lang):
@@ -10,13 +10,11 @@ class AccountMoveSendWizard(models.TransientModel):
Allow archived partners when sending invoices via Allow archived partners when sending invoices via
the 'Send by Email' wizard. the 'Send by Email' wizard.
""" """
# Force archived partners to be visible ONLY in this context
wiz = self.with_context( wiz = self.with_context(
active_test=False, active_test=False,
include_archived_partners=True, include_archived_partners=True,
) )
return super( return super(
AccountMoveSendWizard, AccountInvoiceSend,
wiz wiz
)._get_default_mail_partner_ids(move, mail_template, mail_lang) )._get_default_mail_partner_ids(move, mail_template, mail_lang)