Odoo 12 qweb报告未呈现图像



我的V10 qweb报告中有以下代码。

<img t-if="company.logo_footer" t-att-src="'data:image/png;base64,%s' % company.logo_footer" style="max-height: 30px;"/>

它在V10中的渲染图像是正确的,但在V12中它没有显示图像,我检查了wkhtmltopdf,它安装正确。

我解决了这个问题,在odoo 12中,我们需要将二进制字段传递给一个函数。

<img t-if="company.logo_footer" t-att-src="image_data_uri(company.logo_footer)"  style="max-height: 30px;"/>

这解决了我的问题!!!

最新更新