在Odoo v10报告中添加静态图像

时间:2017-05-28 12:07:25

标签: odoo-10

我目前正在尝试将静态图像添加到Odoo v10报告中。 在Odoo v8中,我使用了像这样的路径的图像标记:

for (List<String>currentData : data) {
    org.apache.commons.lang3.StringUtils.join(currentData, ",")
    System.out.println(System.getProperty("line.separator"));
}

但是在Odoo v10中它只显示一个空矩形。

它是在v10中改变了还是我做错了什么? 文件的路径和名称是正确的。

问候,马蒂亚斯

2 个答案:

答案 0 :(得分:0)

首先要显示的图像是静态图像而不是字段,因此请尝试使用image tag:

<img src="my_module/static/src/img/my_image.png'/>

答案 1 :(得分:0)

这对我来说是显示背景图片的原因:

<div class="page" t-attf-style="background-
image:url('/my_module/static/src/img/my_image.jpg');">

确保当您在浏览器中访问(您的服务器网址)/my_module/static/src/img/my_image.jpg时,您可以看到该图片。

因此,您可以在想要图像的位置将图像作为背景进行空div。