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

Hello,


I want to display the image of my articles on my labels.

In this file "addons/product/report/product_product_templates.xml" we found how the fields are print, like product name:

<tr style="width: 3in;">
                    <td style="border: 2px solid black;width: 2.63in;" colspan="2" class="col-xs-8 danger">
                        <t t-if="product.default_code">
                            [<strong t-field="product.default_code"/>]
                        </t>
                        <strong t-field="product.name"/>
                    </td>
                </tr>

  barcode...

<td style="border: 2px solid black;text-align: center; vertical-align: middle;" class="col-xs-5">
                        <img t-if="product.barcode" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
                        <span t-field="product.barcode"/>
                    </td>


I want to add the product image, (stores in base64 from jpg in my database) Can I add them by this file, and how?

Thank you.

頭像
捨棄
作者 最佳答案

I finnaly find it, in the forum (https://www.odoo.com/fr_FR/forum/aide-1/question/qweb-report-can-t-access-company-fields-110911)

<img t-if="product.image_medium" t-att-src="'data:image/jpg;base64,%s' % (product.image_medium,)" style="max-height:45pt;max-width:90%"/>
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
7月 25
2038
2
6月 24
7483
1
5月 20
3418
0
3月 20
3439
3
12月 19
5760