summaryrefslogtreecommitdiff
path: root/addons/payment/static
diff options
context:
space:
mode:
authorNikunj Ladava <nla@odoo.com>2019-08-02 06:36:43 +0000
committerfw-bot <otis@odoo.com>2019-10-30 12:06:20 +0000
commit8ef1be2e42f3c060db61a1a5d6b463a1cf1a1fd5 (patch)
tree8ea9aff95a8ba91b461d18459ea4d7f704dce342 /addons/payment/static
parent64564343820156c09afeb3eb7c61e79b565f901a (diff)
[FIX] payment: prevent rpc fail event
before this commit it shows error dialog when rpc fail after this commit, error dialog will not be shown to user, instead we have already shown error in payment form task- 2045189 closes odoo/odoo#39571 X-original-commit: e3644c6b59271c521abc151d3c533331836fdc90 Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Diffstat (limited to 'addons/payment/static')
-rw-r--r--addons/payment/static/src/js/payment_form.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/payment/static/src/js/payment_form.js b/addons/payment/static/src/js/payment_form.js
index 345b678d5bf..ce67b467108 100644
--- a/addons/payment/static/src/js/payment_form.js
+++ b/addons/payment/static/src/js/payment_form.js
@@ -246,6 +246,7 @@ publicWidget.registry.PaymentForm = publicWidget.Widget.extend({
// here we remove the 'processing' icon from the 'add a new payment' button
self.enableButton(button);
}).guardedCatch(function (error) {
+ error.event.preventDefault();
// if the rpc fails, pretty obvious
self.enableButton(button);
@@ -299,6 +300,7 @@ publicWidget.registry.PaymentForm = publicWidget.Widget.extend({
);
}
}).guardedCatch(function (error) {
+ error.event.preventDefault();
self.displayError(
_t('Server Error'),
_t("We are not able to redirect you to the payment form.") + " " +
@@ -426,6 +428,7 @@ publicWidget.registry.PaymentForm = publicWidget.Widget.extend({
$(button).children('.fa').addClass('fa-plus-circle');
$(button).find('span.o_loader').remove();
}).guardedCatch(function (error) {
+ error.event.preventDefault();
// if the rpc fails, pretty obvious
$(button).attr('disabled', false);
$(button).children('.fa').addClass('fa-plus-circle');