include product images in invoice or offer
4 posts • Page 1 of 1
include product images in invoice or offerHi,
I would like to include product images in offer our commercial send to customers along with some product description. To do this I was thinking to add an attachement to products with dedicated name like 'offer_image'. The question is, what's the best way to do this ? Here are the different solutions I can see : 1. patch the openErp code to have product object available from invoice_order_line or sale_order_line. This way I can use the get_attachments function on the product object to the get image attachments. 2. patch or submit openoffice.org reporting engine to have an extra function get_attachments_from_objectId(String objectTypeName, int objectID, String attachmentName). ObjectTypeName would be "product_product" and the objectId would be the productId from the invoice_order_line or sale_order_line. 3. use the actual get_attachments function passing a new object with o._name='product_product' and o.id = productId. (I am not sure this is possible). The next question is how to get the sale product descriptions available in product_template table. This can be used as a product description along with the picture in the offer. What do you think ? Hervé
Re: include product images in invoice or offerHi,
what is the problem(?), it works like that out of the box... No need to extend or patch. Sales order line has field product_id, which holds reference to product. You can have get_attachments() function used on this product_id and get your "offer_image" by name. Kaspars
Re: include product images in invoice or offer
Oups, you're right, my mistake. I didn't thought that the product_id member would return a product object. I confirm that : l.product_id.description_sale and a frame with : image: asimage(get_attachments(l.product_id)[0]) are working fine out of the box. Just a last question, I don't know how to get the correct attachement by name. I tried image: asimage(get_attachments(l.product_id)['offer_image']) without succes. Is there a better way that doing a loop on the attachments and test on the name of it ? Thanks for your help, Hervé
Re: include product images in invoice or offerTry like this:
image: asimage(get_attachments(l.product_id, 'offer_image'))
4 posts • Page 1 of 1
|
Copyright © 2001 Alistek Ltd., ALL RIGHTS RESERVED

