I've installed the Attachment module, that allow to attach filesto every module in odoo. The attachments are stored in db in the ir_attachment table.
There is an entry for every attachment related to the id of the object, for example in the table I have:
res_model =account_invoice
res_id = 2886 (this is the id of the invoice)
index_content = 'image'
When I print the invoce I need to print also the image attached to the invoice.
Could you please give me an example of code to be used?