Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
7656 Visualizzazioni

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
Abbandona

debug with assets and check the console

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
gen 21
11884
1
lug 16
11334
1
dic 24
4617
1
ott 20
4812
2
giu 20
4515