Ir al contenido
Menú
Se marcó esta pregunta
8 Respuestas
8449 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor

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>

Autor Mejor respuesta

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
Descartar

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

Autor

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

Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
mar 15
6902
0
mar 15
4149
11
sept 15
3943
3
jul 24
8538
1
mar 18
4389