تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
8 الردود
8448 أدوات العرض

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

الصورة الرمزية
إهمال
أفضل إجابة

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

@keyur can u give your <blockTable style>

الكاتب أفضل إجابة

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

الكاتب

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

أفضل إجابة

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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مارس 15
6900
0
مارس 15
4148
11
سبتمبر 15
3943
3
يوليو 24
8538
1
مارس 18
4388