Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1917 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 12 23
1857
1
thg 7 19
8471
3
thg 3 17
9021
1
thg 3 25
1185
0
thg 11 24
1428