[FIX] payment_stripe: load Stripe.js library on the payment form

When the payment form is displayed, Stripe.js library isn't loaded, thus preventing the customer to pay online.

When the refactor of assets was done, the link to the Stripe library was moved to __manifest__.py.
As the link does not end with '.js', the file wasn't loaded anymore.

See PR #60632

closes odoo/odoo#69849

X-original-commit: 8535b090a36fe6472c4b3d8211f3be39c7f1c58a
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Signed-off-by: Valentin Chevalier <chevalierv@users.noreply.github.com>
This commit is contained in:
Valentin Chevalier
2021-04-26 14:21:11 +00:00
parent 8418f15104
commit 99e785b0d3
2 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -10,6 +10,7 @@
'depends': ['payment'],
'data': [
'views/payment_views.xml',
'views/payment_templates.xml',
'data/payment_acquirer_data.xml',
],
'application': True,
@@ -17,7 +18,6 @@
'uninstall_hook': 'uninstall_hook',
'assets': {
'web.assets_frontend': [
'https://js.stripe.com/v3/',
'payment_stripe/static/src/js/payment_form.js',
],
}
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="checkout" inherit_id="payment.checkout">
<xpath expr="." position="inside">
<!-- As the following link does not end with '.js', it's not loaded when
placed in __manifest__.py. The following declaration fix this problem -->
<script type="text/javascript" src="https://js.stripe.com/v3/"></script>
</xpath>
</template>
<template id="manage" inherit_id="payment.manage">
<xpath expr="." position="inside">
<!-- As the following link does not end with '.js', it's not loaded when
placed in __manifest__.py. The following declaration fix this problem -->
<script type="text/javascript" src="https://js.stripe.com/v3/"></script>
</xpath>
</template>
</odoo>