如何在Odoo的Custom QWeb报告中打印图像? [英] How to print images in Custom QWeb reports in Odoo?
本文介绍了如何在Odoo的Custom QWeb报告中打印图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的自定义Qweb报告中显示用户上传的图片。
I would like to display images which are uploaded by users in my custom Qweb reports.
这是最好的方法吗?
推荐答案
如果你想从数据库中显示图像,你可以像这样使用图像小部件:
If you want to show an image from the database you can just use the image widget like this:
<span t-field="o.image_field_name" t-field-options='{"widget": "image"}'/>
如果你想显示一个存储为文件的图像:
And if you want to show an image stored as a file:
<img t-att-src="'/module_name/static/src/img/image_name.png'" />
注意:尊重订单和报价类型
Note: respect the order and the type of the quotes
这篇关于如何在Odoo的Custom QWeb报告中打印图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文