跳至內容
選單
此問題已被標幟
2 回覆
4107 瀏覽次數

Hi, I have a binary field (widget: image) but neither oth the two method work:


<img t-if="p.plato_ids.icono" t-att-src="'data:image/png;base64,%s' % p.plato_ids.icono"/>

(appears empty square)

  

<span t-field="p.plato_ids.icono" t-field-options='{"widget": "image"}'/>

(appears:  iVBORw0KGgoAAAANSUhEUgAAAH gAAAB3C.............)


anyone knows any other method? Thank you

頭像
捨棄
作者 最佳答案

Finaly that worked form me:

<img t-attf-src="data:image/*;base64,{{p.plato_ids.icono}}"/>

頭像
捨棄
最佳答案

Hi,

Please check this,

<img t-att-src="'data:image/png;base64,%s' % to_text(object.name)"/>

Thanks
Aswini iWesabe 
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
10月 16
3754
1
5月 15
14024
1
7月 25
1730
1
7月 25
1963
1
5月 25
1737