Today i wondered how to add the description to the order report. What has to be done is find a link from the object which gets looped ([[repeatIn(o.order_line,’line‘)]]) to the description field. Here comes the general step-by-step approach on how to do that in openerp. I assume you use the gtk client.
Now we check what fields sale.order has, so we open Administration->Customization->Database structure->Objects and look for sale.order, which has a field order_line with a one2many relation (remember that: [[repeatIn(o.order_line,’line‘)]]? this is where the order_line object is being looped).
Now we look at the sale.order.line object and see a reference to product_id which is a many2one field.
Now check the product.product object and look for product_tmpl_id (product.template).
And finally on our path we reach product.template and inside it a field called description, thats what we need, so we basically have the path from sale.order to the product description, we just need, to concatenate it.
And this is the result: line.product_id.product_tmpl_id.description
And to get it working in our report template we use it like that:
[[ line.product_id.product_tmpl_id.description or removeParentNode(‚tr‘) ]] or
[[ line.product_id.product_tmpl_id.description or “ ]] or
[[ line.product_id.product_tmpl_id.description or removeParentNode(‚para‘) ]]
Special thanks go to alex_joni from the #openobject irc channel who guided me through the tour and showed me the simplicity of openerp. I hope this helps some people.