From 4f7bc691fef38cb27083e79b920e0ac0715ffd7b Mon Sep 17 00:00:00 2001 From: Arnaud Joset Date: Mon, 29 Jan 2024 15:58:22 +0000 Subject: [PATCH] [IMP] avoid sending mail for validation transactions Before this commit, validation transactions would send an email when the token is assigned to the order. closes odoo/odoo#155167 Taskid: 3675875 X-original-commit: f70967e240058d8a6b095fc58c591249e517bd31 Signed-off-by: Arnaud Joset (arj) --- addons/sale/models/payment_transaction.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/sale/models/payment_transaction.py b/addons/sale/models/payment_transaction.py index f0b3c94456f..cccb02941a2 100644 --- a/addons/sale/models/payment_transaction.py +++ b/addons/sale/models/payment_transaction.py @@ -53,6 +53,8 @@ class PaymentTransaction(models.Model): for so in tx.sale_order_ids: so.reference = tx._compute_sale_order_reference(so) + if tx.operation == 'validation': + continue # Send the payment status email. # The transactions are manually cached while in a sudoed environment to prevent an # AccessError: In some circumstances, sending the mail would generate the report assets