diff --git a/addons/payment/static/src/js/payment_form.js b/addons/payment/static/src/js/payment_form.js index c329aa440cf..9abb0b73424 100644 --- a/addons/payment/static/src/js/payment_form.js +++ b/addons/payment/static/src/js/payment_form.js @@ -177,7 +177,7 @@ odoo.define('payment.payment_form', function (require) { }).fail(function (message, data) { self.displayError( _t('Server Error'), - _t("We are not able to redirect you to the payment form.<") + + _t("We are not able to redirect you to the payment form. ") + data.data.message ); }); @@ -220,7 +220,7 @@ odoo.define('payment.payment_form', function (require) { var form_data = this.getFormData(inputs_form); var ds = $('input[name="data_set"]', acquirer_form)[0]; var wrong_input = false; - + inputs_form.toArray().forEach(function (element) { //skip the check of non visible inputs if ($(element).attr('type') == 'hidden') { @@ -396,7 +396,7 @@ odoo.define('payment.payment_form', function (require) { var acquirer_id = this.getAcquirerIdFromRadio(checked_radio); // if we clicked on an add new payment radio, display its form - if (this.isNewPaymentRadio(checked_radio)) { + if (this.isNewPaymentRadio(checked_radio)) { this.$('#o_payment_add_token_acq_' + acquirer_id).removeClass('hidden'); } else if (this.isFormPaymentRadio(checked_radio)) { @@ -414,8 +414,14 @@ odoo.define('payment.payment_form', function (require) { }, displayError: function (title, message) { var $checkedRadio = this.$('input[type="radio"]:checked'), - acquirerID = this.getAcquirerIdFromRadio($checkedRadio[0]), + acquirerID = this.getAcquirerIdFromRadio($checkedRadio[0]); + var $acquirerForm; + if (this.isNewPaymentRadio($checkedRadio[0])) { $acquirerForm = this.$('#o_payment_add_token_acq_' + acquirerID); + } + else if (this.isFormPaymentRadio($checkedRadio[0])) { + $acquirerForm = this.$('#o_payment_form_acq_' + acquirerID); + } if ($checkedRadio.length === 0) { return new Dialog(null, {