Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
7583 Visualizações

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
Cancelar

debug with assets and check the console

Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
jan. 21
11780
1
jul. 16
11265
1
dez. 24
4563
1
out. 20
4765
2
jun. 20
4476