跳至內容
選單
此問題已被標幟
2 回覆
1933 瀏覽次數

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


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
12月 23
1868
1
7月 19
8478
3
3月 17
9039
1
3月 25
1204
0
11月 24
1434