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

Hello All,

I have two types fields one is binary and another is Html type And i want to display both fields on template. My binary field image display on template form but html not display. So, Anyone suggest me how to format html as binary to display my image? Below is my code for template where Binary image display but html field image not.

Thanks in advance

message = fields.Html('Message')
image = fields.Binary('Image')

# For Binary
<a class="thumbnail fancybox" rel="ligthbox" t-att-href="'data:image/png;base64,'+widget.image">
    <img class="align-self-center rounded-circle mr-3" alt=""
    t-att-src="'data:image/png;base64,'+widget.image"/>
</a>
# For Html
<a class="thumbnail fancybox" rel="ligthbox" t-att-href="widget.message">
    <img class="align-self-center rounded-circle mr-3" alt=""
    t-att-src="widget.message"/>
</a>
Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hello All,

i got solution for above problem. my problem solved with following module https://www.odoo.com/apps/modules/11.0/html_image_url_extractor/

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 9 19
5141
2
thg 2 24
3295
1
thg 8 23
4896
6
thg 4 23
17146
2
thg 12 22
6369