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

src="/module_name/static/description/image.png" does not seem to work on image tags in my xml template. I'm on odoo16.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

I added class="article" to the top div element and suddenly the report came to life. My images displayed, the font was set etc I don't know what it does but it worked for me. Thanks for the help anyways

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,
Refer to the below code

<template id="your_template_id" inherit_id="your_inherited_template_id" name="Your Template Name">
    <!-- Add the web directive to reference static assets -->
    <xpath expr="//img/@src" position="replace">
<attribute name="t-att-src">web/image/module_name/static/description/image.png</attribute>
    </xpath>

    <!-- Your other template content goes here -->
</template>

Hope it helps


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ธ.ค. 23
1852
1
ก.ค. 19
8469
3
มี.ค. 17
9018
1
มี.ค. 25
1182
0
พ.ย. 24
1426