Odoo Help


Line Breaks in RML Reports

Alex Gallien
on 11/5/14, 1:53 PM 5,144 views

I have some Sales Order Lines that have long descriptions that require line breaks to be readable. I put line breaks into the description (description_sale field), but when I create a pdf to print/send these line breaks go away. Is there any way to force a line break to stay? Is this an issue with rmltopdf, or can I solve it in OpenERP?

On 11/5/14, 8:44 PM

Hi Alex,

You could try something like this:

        <para style="terp_default">[[ repeatIn(line.name and line.name.split('\n') or [],'desc_line') ]]</para>
        <spacer length="10">[[ desc_line != '' and removeParentNode('spacer') ]]</spacer>
        <para style="P3">[[ format(desc_line) or '' ]]</para>

Hope that this helps :)


I tried adding this code (and variations) but it caused the text to not render at all. Any idea why that might be? I thought repeatIn() only worked over records, can it be use on individual lines like this too?

Alex Gallien
on 11/6/14, 2:06 PM

To be honest, I don't have a clue why it's not working at your end. :( We're using this approach constantly in our projects. Maybe you could provide your code or something ...

on 11/6/14, 7:49 PM

Well not sure what my deal was last time, but I got it working today. Thanks for your help, I probably wouldn't have been able to figure that out on my own.

Alex Gallien
on 11/7/14, 2:20 PM



| 5 3 8
Delhi, India

Nothing to say .... :)

On 5/22/15, 6:56 PM

try <xpre> tag instead of <para> that respects spaces and line breaks.

<xpre color="black">[[ line.name or '' ]]</xpre> 

Hi, the syntax was really helpful, I have applied for a Text field, In PDF it was able to display the spaces but the for description unable to display the complete text,can you please help me. EX: 1.Above material will be delivered within 4 day from date of issue of Order. 2.Payment will be made after delivery. 3.The above prices are inclusive of all taxes. 4.Statutory Levies and tax at source shall be deducted as per the prevailing acts. 5.HMRI reserves the right to cancel this Purchase Order at any point of time, if the services provided by the vendor are not upto the HMRI expectation or if any deviation is found from the vendor’s side on the terms and conditions mentioned in this Purchase Order. 6.Delivery of the item will be free of cost including its packing & forwarding charges. In case of 5 condition the content was displaying half only rest was not displaying????.Is there any alternative solution.

syam sundar singh
on 1/6/16, 1:21 AM

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

3 follower(s)


Asked: 11/5/14, 1:53 PM
Seen: 5144 times
Last updated: 5/22/15, 6:58 PM