Skip to Content
Menu
This question has been flagged
2 Replies
7518 Zobrazenia

I am trying to load custom js and css in my module but .css file is loading perfectly but js is  not loading.

my code is below

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="assets_backend_" name="Extra Feature" inherit_id="web.assets_backend">
<xpath expr=".">
<script type="text/javascript" src="/my_module/static/src/js/labou.js"/>
<link rel="stylesheet" href="/my_module/static/src/css/labou.css"/>
</xpath>
</template>

</data>
</odoo>
Avatar
Zrušiť

debug with assets and check the console

Best Answer

Hi,

try it this way:

<template id="assets_frontend" inherit_id="website.assets_frontend">
    <xpath expr="script[last()]" position="after">
        <script type="text/javascript" src="/my_module/static/src/js/labou.js"></script>
    </xpath>
</template>

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
1
jan 21
11716
1
júl 16
11197
1
dec 24
4449
1
okt 20
4687
2
jún 20
4401