Odoo Help

Welcome!

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

0

Line Breaks in RML Reports

By
Alex Gallien
on 11/5/14, 1:53 PM 3,302 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?

3
Petar
On 11/5/14, 8:44 PM

Hi Alex,

You could try something like this:

<td>
    <section>
        <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>
    </section>
</td>

Hope that this helps :)

Cheers,
Petar

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

Petar
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
0
Yogesh
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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

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