Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

2

How can I add a product's image in report? [Closed]

By
CK
on 4/3/13, 12:05 AM 4,067 views

The Question has been closed

by
Sudhir Arya (SA)
on 04/18/2013 05:02:46

I want to add a image in the purchase order, and I add: o.order_line.product_image in sxw. But it can't show in my report_order...

Maybe is because "o.order_line.product_image" is binary ? And how can I do with it .... Thanks

3

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 4/3/13, 1:41 AM

You can use <image> tag in rml.

Try this;

    <image x="1.3cm" y="27.8cm" height="40.0" >[[product_id.product_image]]</image>

or

    <image height="30.0" width="40.0">[[product_id.product_image]]</image>

or you can put image conditionally like this:

    <para>[[ product_id.product_image and setTag('para','image',{'width':'50.0','height':'50.0'}) or removeParentNode('para') ]][[ product_id.product_image ]]</para>

The image is loading. but after changing some more things in my .sxw and then conveting it to rml gives some alphanumeric values in place of the image...

Sreedath Namangalam
on 4/25/13, 11:03 AM

Hello Sudhir! It is interesting, because if I add a new column in to my sale.order report /.sxw/ and put the already showing context like: [[ format(line.name) ]] or [[ formatLang(o.amount_untaxed, dp='Account', currency_obj=o.pricelist_id.currency_id) ]] it is working and showing on the printed .pdf file. In other case if I put the [[product_id.product_image]] it is not showing up, it is only gives some alphanumeric values. It seem it is not the problem with the .sxw file, but the product image pathname. Can you please sorted this out?

Kris Krnacs
on 5/30/13, 7:20 AM

Hello Sudhir, I want to a extra table in my sale and purchase order such as serial numbers 1,2,3...... for the number of products entered can you please help me out

Sampath Kumar S
on 11/12/13, 8:33 AM
0
CK
On 4/3/13, 7:05 AM

I find that if I have used openoffice to change the sxw, then I can't change the rml in addons/**/report ....

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 4/3/13, 12:05 AM
Seen: 4067 times
Last updated: 3/16/15, 8:10 AM