[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.
This commit is contained in:
Damien Bouvy
2016-03-23 16:38:57 +01:00
parent a4f8464be7
commit 7682760dca
2 changed files with 4 additions and 2 deletions
@@ -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();
});
});
});
@@ -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();
});
});