Odoo Help


How to avoid showing a list without elements in a RML report?

Juan Formoso
on 6/19/14, 12:08 PM 1,213 views

I am trying to print a RML report in the 7.0 version. The report shows a list of elements (when their properties x and y are 0.0) in a table, each one in a different row. It works well, except for one case: when the list is empty, it gives an error. So I am racking my brains to know how to control that condition, I am a newbie in this and I cannot understand why the next lines are not working:

<blockTable  style="my_style">


        [[repeatIn(report.line_ids, 'line')]]

        [[line and (line.x==0.0 and line.y==0.0 and removeParentNode('tr')) or removeParentNode('blockTable')]]

        <td> ... </td>



Please any answer or reference to a tutorial of dynamic RML reports (like this, but unfortunately, this one was not enough: https://doc.openerp.com/v6.0/developer/3_11_reports/11_1_openoffice_report.html/#dynamic-content-in-openoffice-reports) or something similar will be appreciated a lot. Thank you in advance!


Thank you Leonardo! I tried both solutions but the error is still there. My table was divided in five columns, so I have to write not only an empty <tr></tr> but five <td></td> too! But now it works!!


Leonardo Donelli

--Leonardo Donelli--
| 5 4 8
Roma, Italy
--Leonardo Donelli--

Physics student and part-time developer.

Leonardo Donelli
On 6/19/14, 12:14 PM

I found myself with the same problem and, as far as I recall, it was due to the fact that you can't have a <blockTable> without <tr> inside, which is what happens if the list is empty.

I solved the problem by putting a "fake" empty first line (<tr><para>  </para></tr>) so that there is at least always one line , but I think you could try, as a better solution, to change your repeatIn line with this one:

[[report.line_ids and repeatIn(report.line_ids, 'line') or removeParentNode('blockTable')]]


About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 6/19/14, 12:08 PM
Seen: 1213 times
Last updated: 3/16/15, 8:10 AM