Wednesday, August 22, 2012

How to print image to openERP report

Recently a client was asking us to customize a report which require to print images from the database , after much research which I hope my sharing can be part of a sharing to the openERP community of Malaysia , Singapore local users as well as developer from around the world as well , here are the instruction i found ,

For Openerp 6.1-1

To insert the product image into Purchase order .
The procedure is to insert the following line code in RML format (Using the RML edit)


[[line.product_id.product_image]]


What is important in the above line is the line.product_id.product_image the other formats has to be changed later to adjust the image and its position into the form.

If using the integrated image (mainly the default base that comes with openerp 6.1) 
under section:


[[repeatIn(o.order_line,'line')]][[line.product_id.product_image]]


If using Chricar_product_image

[[repeatIn(o.order_line,'line')]][[line.product_id.picture]]



As for invoice you just need to insert the following line and it should works without a problem.
[[l.product_id.product_image]]
The best fit  :

[[repeatIn(o.order_line,'line')]]


[[ line.name ]] [[line.product_id.product_image]]


Putting the image under Description requires that : [[line.product_id.product_image]] is placed under [[line.name]]

the same applies to Purchase order and invoice as the above was applied to the sales.order

Hope this can be a help to some of us to shorten our research time somehow . 

And this information are taken from the 
http://www.openerp.com/forum/topic32445.html by Tedd.


HTH , Happy openERPing ! 

1 comment:

  1. Hi,

    tested these changes on our demo server but we get a line of characters and no image.

    Can you give use more info or help

    best regards

    ReplyDelete

Note: Only a member of this blog may post a comment.