Odoo Help


How to access nested reference fields in openoffice reports.

on 6/27/13, 5:46 AM 2,936 views

Am trying to enhance my open office report data with few more additional data. But am not able to access the nested referenced table values in to my report

Eg:- I want to show following columns [ Product Name , Description , Quantity , Unit Price , subtotal] in my purchase order report (open office) , but as of now in default template there is no option to see the Product Name. How can i add that information in to the report.

Table reference goes like this : purchase_order_line(pruduct_id) -> product_product(product_tmpl_id) -> product_template

Issue :- I wand to fetch the name field of product_template table in to my report.

Reference :- current report has loop starts like as follows ,


[[ line.name ]] --> this field just gives description from the purchase_order_line table

Any hint point to the answer is highly appreciated.. Thanks in advance ..



| 4 4 8
Ahmedabad, India

Odoo Expert

On 6/27/13, 8:09 AM

Hi Nishad,

You can fetch product name by

[[ line.name ]]
Product Name - [[ line.product_id.name ]]

You can also fetch product template id by

[[ line.name ]]
Product Template Name - [[ line.product_id.product_tmpl_id.name ]]

Thanks ...Yes it works fine.... There is an alternate way to cross check this . Check whether the field names are exactly identified by the rml file generated from this .sxw file or not ie After modification in openoffice doc just export that to rml , there if you find any spaces in between the fields then the report won't generate as you wish.

on 6/30/13, 9:56 AM

Yes Nishad. That unwanted spaces caused a real disaster at initial stage. After converting the report if it is not converted it is better to change directly in rml instead doing change in sxw & again converting in rml. Thanks for suggestion.

on 6/30/13, 10:12 AM

Hi Guys, I'm facing a problem with this.....I've a custom module with multiple line items from another module., in my report i need to display some info from my custom module and will have a table containing the line items on the report. I'm using both the loops exactly the same way as mentioned above by Keyur, but when i send it to server and click on print to generate PDF, i'm getting a NameError, name 'o' is not defined. Please help me :)

on 1/14/14, 8:09 AM

You need to specify [[ repeatIn(objects,'o') ]] in you report.sxw file.

on 1/20/14, 5:58 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 6/27/13, 5:46 AM
Seen: 2936 times
Last updated: 3/16/15, 8:10 AM