This question has been flagged
8 Replies
7296 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

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author

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

@keyur can u give your <blockTable style>

Author Best Answer

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

Avatar
Discard

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

Author

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

I am facing same problem, i want repeat column

Is anyone here please

Best Answer

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

Avatar
Discard