Files
odoo_source/addons/payment_adyen/views/payment_templates.xml
T
Antoine Vandevenne (anv) 66f204ecd3 [PRF] payment_adyen: only load the SDK on pages with a payment form
The SDK of Adyen Checkout is quite large (≲ 1MB) and was always loaded
on all frontend pages before this commit, which hurt the loading
performances.

This commit restricts the loading of the SDK to pages that include one
of the payment forms (either 'checkout' or 'manage').

task-2899271

closes odoo/odoo#95121

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-04 14:08:07 +02:00

29 lines
1008 B
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="checkout" inherit_id="payment.checkout">
<xpath expr="." position="inside">
<t t-call="payment_adyen.sdk_assets"/>
</xpath>
</template>
<template id="manage" inherit_id="payment.manage">
<xpath expr="." position="inside">
<t t-call="payment_adyen.sdk_assets"/>
</xpath>
</template>
<template id="sdk_assets">
<script src="https://checkoutshopper-live.adyen.com/checkoutshopper/sdk/4.7.3/adyen.js"
integrity="sha384-YiT4BfPwbplFwUnpDjm2rmWCvpzdi6+l+1E+J9JKTB3CYyKbbwJ8ghkUheQf79X9"
crossorigin="anonymous">
</script>
<link rel="stylesheet"
href="https://checkoutshopper-live.adyen.com/checkoutshopper/sdk/4.7.3/adyen.css"
integrity="sha384-X1zQUhO5NGWdMQmDcuv2kyQK65QR7/VJtNthEImZm7jOvOEicQrnVijI0n9DcHkF"
crossorigin="anonymous">
</link>
</template>
</odoo>