跳至内容
菜单
此问题已终结

I'm trying to rescale images inside a report because they are big, but is not working. I'm trying with t-field-options='{"widget": "image", "size":[512,512]}' but it does nothing. I've tried with css/styles too but it isn't changing the size. What else could I try?

Thanks

形象
丢弃
最佳答案

Hi,

datas is binary field,

<span t-field="o.datas" t-field-options='{"widget": "image", "style":"width: 150px;height: 150px"}'/>

形象
丢弃
最佳答案

Hi Nacho,

This how company logo is set on report header

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

Best regards.

形象
丢弃
编写者 最佳答案

A lot of thanks Bejaoui Souheil, the problem was the widget option, with your code I can give to the image the size I want

形象
丢弃

Happy to Help :)

相关帖文 回复 查看 活动
1
12月 21
4922
1
6月 20
4656
1
12月 19
7403
5
6月 17
9057
5
11月 16
6899