From 7682760dcad232829fbb5d4221f66a1ebb9d6c91 Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Wed, 23 Mar 2016 14:38:21 +0100 Subject: [PATCH] [FIX] website_sale,website_quote: form must be in dom to be submitted Revision 15f27b2 introduced a dynamic form submission to avoid some payment transaction problems. It so happens that form submission in jquery necessitates said form to actually be in the dom (at least for Firefox and some version of MSIE); this revision ensures that the form is updated in the dom by the rpc call then properly submitted. --- addons/website_quote/static/src/js/website_quotation.js | 3 ++- addons/website_sale/static/src/js/website_sale_payment.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/website_quote/static/src/js/website_quotation.js b/addons/website_quote/static/src/js/website_quotation.js index 3221eeba0a4..2ff25986179 100644 --- a/addons/website_quote/static/src/js/website_quotation.js +++ b/addons/website_quote/static/src/js/website_quotation.js @@ -212,7 +212,8 @@ odoo.define('website_quote.payment_method', function (require) { var token = href.match(/quote\/[0-9]+\/([^\/?]*)/); token = token ? token[1] : ''; ajax.jsonRpc('/quote/' + order_id +'/transaction/' + acquirer_id + (token ? '/' + token : ''), 'call', {}).then(function (data) { - $(data).submit(); + $form.html(data); + $form.submit(); }); }); }); diff --git a/addons/website_sale/static/src/js/website_sale_payment.js b/addons/website_sale/static/src/js/website_sale_payment.js index d16a91b8b86..5b02f5b7c61 100644 --- a/addons/website_sale/static/src/js/website_sale_payment.js +++ b/addons/website_sale/static/src/js/website_sale_payment.js @@ -30,7 +30,8 @@ $(document).ready(function () { return false; } ajax.jsonRpc('/shop/payment/transaction/' + acquirer_id, 'call', {}).then(function (data) { - $(data).submit(); + $form.html(data); + $form.submit(); }); });