From 428f7b062c7779037f11a6580fa333d41de8396d Mon Sep 17 00:00:00 2001 From: Kristof Bernaert Date: Sun, 1 Feb 2026 17:03:22 +0100 Subject: [PATCH] correct problem for sending invoice emails --- allow_mail_archived_partner/models/__init__.py | 3 ++- allow_mail_archived_partner/models/account_move.py | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 allow_mail_archived_partner/models/account_move.py diff --git a/allow_mail_archived_partner/models/__init__.py b/allow_mail_archived_partner/models/__init__.py index 530a9b3..a2ad74d 100755 --- a/allow_mail_archived_partner/models/__init__.py +++ b/allow_mail_archived_partner/models/__init__.py @@ -3,4 +3,5 @@ from . import mail_thread from . import res_partner from . import mail_template from . import mail_compose_message -from . import account_move_send \ No newline at end of file +from . import account_move_send +from . import account_move \ No newline at end of file diff --git a/allow_mail_archived_partner/models/account_move.py b/allow_mail_archived_partner/models/account_move.py new file mode 100755 index 0000000..a05cd2a --- /dev/null +++ b/allow_mail_archived_partner/models/account_move.py @@ -0,0 +1,13 @@ +from odoo import models + +class AccountMove(models.Model): + _inherit = "account.move" + + def _send_invoice(self): + if self.env.context.get("force_email") or self.env.context.get("mark_invoice_as_sent"): + return super( + AccountMove, + self.with_context(active_test=False) + )._send_invoice() + + return super()._send_invoice()