Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
13109 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

datas is binary field,

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ

Happy to Help :)

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 12 21
4923
1
thg 6 20
4660
1
thg 12 19
7405
5
thg 6 17
9060
5
thg 11 16
6902