Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
7688 มุมมอง

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>
อวตาร
ละทิ้ง

debug with assets and check the console

คำตอบที่ดีที่สุด

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>

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Execute JS Code on custom module only แก้ไขแล้ว
1
ม.ค. 21
11909
1
ก.ค. 16
11360
1
ธ.ค. 24
4666
1
ต.ค. 20
4846
2
มิ.ย. 20
4572