Odoo Help

Welcome!

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

0

How to access nested reference fields in openoffice reports.

By
nishad
on 6/27/13, 5:46 AM 2,149 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 ,

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

[[ 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 ..

0

Keyur

--Keyur--
1165
| 4 4 8
Ahmedabad, India
--Keyur--

Odoo Expert

Keyur
On 6/27/13, 8:09 AM

Hi Nishad,

You can fetch product name by

[[repeatIn(o.order_line,'line')]]
[[ line.name ]]
Product Name - [[ line.product_id.name ]]

You can also fetch product template id by

[[repeatIn(o.order_line,'line')]]
[[ 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.

nishad
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.

Keyur
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 :)

ASP
on 1/14/14, 8:09 AM

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

Keyur
on 1/20/14, 5:58 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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