تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5427 أدوات العرض

 

Is it possible to put product images in Reporting of Sales, Purchase and Inventory Analysis.

I need product image along with product title when I drill down on products.

Can anyone help me how to modify reporting query and xml structure to display two attributes(image, title) of products.



الصورة الرمزية
إهمال

Hi Michael, you are asking about Reporting analysis right? Not just the pdf reports of sale order, purchas order etc right?

الكاتب

Hi Akhil, You're right I am asking about Reporting, not about PDF reports. Thanks

أفضل إجابة

You just need to add below line in order line or invoice line table,

<img t-if="l.product_id.image" t-att-src="'data:image/png;base64,%s' % l.product_id.image" style="width:90px; height:90px;"/>

where, l is,

<t t-foreach="o.invoice_line" t-as="l"> or <t t-foreach="o.order_line" t-as="l">


For example,

if you want to add product title and image using xml than,

<table class="table table-bordered">

    <thead>

    <tr>

        <th><strong>Product Title</strong></th>

        <th><strong>Image</strong></th>

    </tr>

    </thead>

    <tbody>

    <tr t-foreach="o.invoice_line" t-as="l">

        <td>span t-field="l.name"/</td>

        <td><img t-if="l.product_id.image" t-att-src="'data:image/png;base64,%s' % l.product_id.image" style="width:90px; height:90px;"/></td>

    </tr>

    </tbody>

</table>


Regards,

الصورة الرمزية
إهمال
الكاتب

Thanks for the explanation, I guess you misunderstood my question. I was asking about Reporting e.g. Reporting / Sales / Sales Analysis.

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
سبتمبر 22
3452
2
يونيو 17
125
4
أكتوبر 16
6983
3
فبراير 25
17525
1
ديسمبر 23
2186