Merge lp:~therp-nl/openobject-server/7.0-lp1260743_print_empty_lines into lp:openobject-server/7.0

Proposed by Ronald Portier (Therp)
Status: Needs review
Proposed branch: lp:~therp-nl/openobject-server/7.0-lp1260743_print_empty_lines
Merge into: lp:openobject-server/7.0
Diff against target: 23 lines (+11/-2)
1 file modified
openerp/report/render/rml2pdf/trml2pdf.py (+11/-2)
To merge this branch: bzr merge lp:~therp-nl/openobject-server/7.0-lp1260743_print_empty_lines
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+199103@code.launchpad.net

Description of the change

Print empty lines when generating rml reports.

Fixes lp:1260743.

To post a comment you must log in.

Unmerged revisions

5173. By Ronald Portier (Therp)

[FIX] Fixes lp1260743.
    Make sure empty lines in lay-out are really printed.
    Some of this code is aready present in community branch, but not
    functional because of missing   entity reference. Printing a
    space is not enough, even when embedded in (dummy) <font> tag.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/report/render/rml2pdf/trml2pdf.py'
2--- openerp/report/render/rml2pdf/trml2pdf.py 2013-11-19 18:53:53 +0000
3+++ openerp/report/render/rml2pdf/trml2pdf.py 2013-12-16 12:32:56 +0000
4@@ -782,8 +782,17 @@
5 if extra_style:
6 style.__dict__.update(extra_style)
7 result = []
8- for i in self._textual(node).split('\n'):
9- result.append(platypus.Paragraph(i, style, **(utils.attr_get(node, [], {'bulletText':'str'}))))
10+ textuals = self._textual(node).split('\n')
11+ keep_empty_lines = (len(textuals) > 1) and len(node.text.strip())
12+ for i in textuals:
13+ if keep_empty_lines and len(i.strip()) == 0:
14+ i = '<font color="white">&nbsp;</font>'
15+ result.append(
16+ platypus.Paragraph(
17+ i, style, **(
18+ utils.attr_get(node, [], {'bulletText':'str'}))
19+ )
20+ )
21 return result
22 elif node.tag=='barCode':
23 try: