From 1803571bdb3545df527ade6dacca8809a5209f73 Mon Sep 17 00:00:00 2001 From: Demaret Rivarola Johan Date: Mon, 24 Sep 2018 14:54:26 +0200 Subject: [PATCH] [FIX] payment: always redirect when using wire transfer The user should always be redirected when paying with wire transfer. This is because the landing page displays useful data such as the communication. Closes #27194 --- addons/payment/controllers/portal.py | 1 + addons/payment/static/src/js/payment_processing.js | 4 ++++ .../static/src/js/website.tour.event_sale.js | 5 ----- addons/website_sale/static/src/js/website_sale_tour_buy.js | 5 ----- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/addons/payment/controllers/portal.py b/addons/payment/controllers/portal.py index 057ee72aa3b..c3a45c3c6bd 100644 --- a/addons/payment/controllers/portal.py +++ b/addons/payment/controllers/portal.py @@ -268,6 +268,7 @@ class WebsitePayment(http.Controller): else: status = 'danger' message = tx.acquirer_id.error_msg + PaymentProcessing.remove_payment_transaction(tx) return request.render('payment.confirm', {'tx': tx, 'status': status, 'message': message}) else: return request.redirect('/my/home') diff --git a/addons/payment/static/src/js/payment_processing.js b/addons/payment/static/src/js/payment_processing.js index 196e694399e..3497297d665 100644 --- a/addons/payment/static/src/js/payment_processing.js +++ b/addons/payment/static/src/js/payment_processing.js @@ -85,6 +85,10 @@ odoo.define('payment.processing', function (require) { transactions.forEach(function (tx) { var key = 'tx_' + tx.state; if(key in render_values) { + if (tx.acquirer_provider === 'transfer') { + window.location = tx.return_url; + return; + } render_values[key].push(tx); } }); diff --git a/addons/website_event_sale/static/src/js/website.tour.event_sale.js b/addons/website_event_sale/static/src/js/website.tour.event_sale.js index c6dafbb019e..4686e9595b0 100644 --- a/addons/website_event_sale/static/src/js/website.tour.event_sale.js +++ b/addons/website_event_sale/static/src/js/website.tour.event_sale.js @@ -85,11 +85,6 @@ tour.register('event_buy_tickets', { extra_trigger: '#payment_method label:contains("Wire Transfer") input:checked,#payment_method:not(:has("input:radio:visible"))', trigger: 'button[id="o_payment_form_pay"]:visible', }, - { - content: "Payment processing", - trigger: 'a[class="list-group-item"]', - timeout: 5000, - }, { content: "Last step", trigger: '.oe_website_sale:contains("Pending... The order will be validated after the payment.")', diff --git a/addons/website_sale/static/src/js/website_sale_tour_buy.js b/addons/website_sale/static/src/js/website_sale_tour_buy.js index 74a307a480b..b16eaf8638b 100644 --- a/addons/website_sale/static/src/js/website_sale_tour_buy.js +++ b/addons/website_sale/static/src/js/website_sale_tour_buy.js @@ -78,11 +78,6 @@ tour.register('shop_buy_product', { extra_trigger: '#payment_method label:contains("Wire Transfer") input:checked,#payment_method:not(:has("input:radio:visible"))', trigger: 'button[id="o_payment_form_pay"]:visible:not(:disabled)', }, - { - content: "Payment processing", - trigger: 'a[class="list-group-item"]', - timeout: 5000, - }, { content: "finish", trigger: '.oe_website_sale:contains("Pending... The order will be validated after the payment.")',