我希望使用Odoo 10在报表的标题中插入一个徽标。
我测试了
<img t-att-src = "'/ lt_sales / static / src / img / logo.png'" />和
<img class = "img" src = "/ lt_sales / static / src / img / logo.png" />它在Odoo 8中运行,没有任何问题,但在Odoo 10中没有问题。为什么,我如何修复它?
发布于 2018-05-25 11:44:54
如果您想使用公司徽标:
<div class="col-xs-6 text-right">
<img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 50px;" />
</div>如果要插入静态图像(报表),则需要将图像放在文件夹中:
<div class="col-xs-6 text-right">
<img class="img-responsive" src="/lt_sales/static/src/img/logo.png" style="max-height: 50px;" />
</div>发布于 2021-09-20 15:29:44
我在标题中有这样的代码来显示公司的徽标,但没有起作用:
<div style="max-height: 78px">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-width: 100%; height: auto;align-items: center; " alt="Logo"/>
</div>我改了这个,现在工作正常:
<div style="max-height: 76px">
<img t-if="company.logo" t-attf-src="data:image/*;base64,{{company.logo}}" t-att-alt="logo" style="max-width: 100%; height: auto;align-items: center; "/>
</div>还有另一个有趣和难以发现和解释的问题。
我的生产和开发环境都运行了Ubuntu20.04.3LTS。我检查了wkhtmltopdf版本,两者都是wkhtmltopdf 0.12.6 (带有修补的qt)。
我发现有一份报告说,有一些记录没有显示徽标,如果我排除了一些记录,标识就没问题。在开发环境中,标识在每一种情况下都是正常的。因此,我将wkhtmltopdf从开发环境复制到生产中,现在它似乎运行良好。
因此,如果您尝试了所有的东西,而您的标识有问题,请尝试下载另一个版本的wkhtmltopdf。
https://stackoverflow.com/questions/50491186
复制相似问题