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 use repeatln()

By
Alex Gallien
on 5/27/14, 7:13 PM 980 views

Hi guys,

I am trying to access the note field in mrp.routing.workcenter in a customized Production Order report but can't figure out how to use the repeatln() function. For reference, I am using the OpenOffice plugin to edit my reports and OpenERP v7.

Currently I am using the code

    [[ repeatln(o.routing_id.workcenter_lines,'line3') ]]

right before a 2x1 table containing [[ line3.name ]] and [[ line3.note ]]. However this is not producing any results for me. Any idea why not? Can I not daisy chain to my 'note' field like I did there when working with repeatln()? Is it some sort of limitation with the OpenOffice plugin? Thanks!

0

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 5/28/14, 5:03 AM

You are using rml reports...
check the RML user guide and get to know how it works.. 
Basicly... repeatIn() is a function that uses iterates over objects ('o') wich contains other objects... 

see sale order fro example, and rml file ( addons/sale/report/sale_order.rml )
... search for <pto> tag ( line109) you will find starting : 
[[repeatIn(objects,'o')]] 
-> o is the sale_order object,
.... use any objects 'o'  attributes ( o.name, o.patrner_id.name ... ) in report 
... go down to line 241 -> [[ repeatIn(o.order_line,'line') ]] 
-> here  o.order_line is another iterable object nested in 'o'  and parser iterates over it using name 'line'
... to get data from lines use line.name, line.qty etc... 

hope this helps to understand meaning of repeatIn()

in your case... 
you shoud probably triple-iterate... 

1.repeatIn(objects,'o')
2. repeatIn(o.routing_id,'r')
3.repeatIn(r.workcenter_lines,'line')

and then use line.name , line.note 

hope it helps 


 

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: 5/27/14, 7:13 PM
Seen: 980 times
Last updated: 3/16/15, 8:10 AM