From a29971df5555b80b2fe0731fd22167b363860760 Mon Sep 17 00:00:00 2001 From: "Valeriya(vchu)" Date: Mon, 5 Jun 2023 12:58:42 +0000 Subject: [PATCH] [FIX] payment_adyen: prevent override of the server error by the generic one Before this commit the generic message error was shown in the payment form instead of the server error message that did not allow the users to understand the problem that caused it. After this commit the server error is shown in the payment form. closes odoo/odoo#124040 X-original-commit: dc1230648415dbeeb672c6fb9168472ac8c7d651 Signed-off-by: Antoine Vandevenne (anv) Signed-off-by: Valeriya Chuprina (vchu) --- addons/payment_adyen/static/src/js/payment_form.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/payment_adyen/static/src/js/payment_form.js b/addons/payment_adyen/static/src/js/payment_form.js index 7ca21cb061a..b65495e383b 100644 --- a/addons/payment_adyen/static/src/js/payment_form.js +++ b/addons/payment_adyen/static/src/js/payment_form.js @@ -53,10 +53,12 @@ * @return {undefined} */ _dropinOnError: function (error) { - this._displayError( - _t("Incorrect Payment Details"), - _t("Please verify your payment details.") - ); + if (!this.$('div[name="o_payment_error"]')) { // Don't replace a specific server error. + this._displayError( + _t("Incorrect Payment Details"), + _t("Please verify your payment details.") + ); + } }, /**