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

repeatIn don't work inside a tag <td> for repeat columns in rml reports

By
Daniel Palomino
on 5/27/13, 5:46 PM 3,672 views

I want to repeat columns in a rml report using the method 'repeatIn' inside a tag -td- but didn't have success. It is my code:

<*blockTable style="row" colWidths="10cm,3cm" >

<*tr>

<td><para style="default_bold">[[ the_data['shop']['name'] or '' ]]</para> </td>

<td> <section>

<para>[[ repeatIn(the_data['shop']['products'], 'product') ]]</para>

<para style="default_right">[[ product['amount'] and formatLang(product['amount'], digits=2) or '0' ]]</para>

</section> </td>

</tr> </blockTable>

Where: the_data['shop']['products'] is a list of amounts of products and i need to show this in columns, but when I execute this code, it repeat the rows,not the columns.

I need some help please.

Note: I use '*' in some tags for can write this post

2

Keyur

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

Odoo Expert

Keyur
On 5/28/13, 2:34 AM

Hi, Daniel. I think concept of repeatIn with <section> you defined in second <td> is a bit confusing.

The use of repeatIn is to repeat rows, one can not restrict columns. Here you have defined repeatIn for second column only with <section>.

Try to write like this,

<blockTable style="row" colWidths="10cm,3cm" >
    <section>
        <para>[[ repeatIn(the_data['shop']['products'], 'product') ]]</para>
        <tr>
            <td>
                <para style="default_bold">[[ the_data['shop']['name'] or '' ]]</para>
            </td>
            <td>
                <para style="default_right">[[ product['amount'] and formatLang(product['amount'], digits=2) or '0' ]]</para>
            </td>
        </tr>
    </section> 
</blockTable>

Now that will work properly.

Thanks.

Thanks Keyur for your help, but i've tried that form too and have not been successful, because it repeat only the rows again.

Today, i get the answer: In the file bin/report/preprocess.py there is a list

rml_parents = ['tr','story','section']

that not have a definition about 'td', then when the openerp try to find the parent tag 'td' it fails.

Fortunately it only works locally and can modify this list to

rml_parents = ['td','tr','story','section'] and worked fine !!!.

Daniel Palomino
on 5/28/13, 1:18 PM

@keyur can u give your <blockTable style>

Jagdish Panchal
on 12/6/13, 9:02 AM
1
Daniel Palomino
On 5/28/13, 1:14 PM

Thanks Keyur for your help, but i've tried that form too and have not been successful, because it repeat only the rows again.

Today, i get the answer: In the file bin/report/preprocess.py there is a list

rml_parents = ['tr','story','section']

that not have a definition about 'td', then when the openerp try to find the parent tag 'td' it fails.

Fortunately it only works locally and can modify this list to

rml_parents = ['td','tr','story','section'] and worked fine !!!.

Be careful when you do an upgrade of openERP. Because files in that location can be overridden by the upgrade....

patrick
on 5/28/13, 5:15 PM

I've revised different versions of openerp and the definition of rml_parents = ['tr','story','section'] in bin/report/preprocess.py is iqual.

Daniel Palomino
on 5/28/13, 5:23 PM

I am facing same problem, i want repeat column

Jagdish Panchal
on 12/6/13, 8:56 AM

Is anyone here please

Drees Far
on 9/1/15, 6:22 AM
0
camp
On 8/3/15, 3:59 AM

hi keyur,

 can you help me to find answer for this question? please.

https://www.odoo.com/forum/help-1/question/varying-table-alignment-while-using-pto-and-pto-header-in-rml-88818

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/13, 5:46 PM
Seen: 3672 times
Last updated: 8/3/15, 3:59 AM