Merge lp:~olivier-laurent/openobject-server/6.1-bug1157048 into lp:openobject-server

Proposed by Olivier Laurent (Acsone)
Status: Needs review
Proposed branch: lp:~olivier-laurent/openobject-server/6.1-bug1157048
Merge into: lp:openobject-server
Diff against target: 16 lines (+5/-1)
1 file modified
openerp/report/render/rml2pdf/trml2pdf.py (+5/-1)
To merge this branch: bzr merge lp:~olivier-laurent/openobject-server/6.1-bug1157048
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+154031@code.launchpad.net

Description of the change

The change is similar to:
- lp:~openerp-dev/openobject-server/trunk-opw-576860-port-kbh
- lp:~acl-openerp/openobject-server/6.1-opw-576860-acl
- lp:~openerp-dev/openobject-server/7.0-opw-587565-nep

But it avoids the side effect consisting to produce a blank line on each "technical" empty paragraph found in the rml template itself. Only blank lines coming from user data are taken into account.

To post a comment you must log in.

Unmerged revisions

4067. By Olivier Laurent (Acsone)

FIX: Do not remove empty lines in the pdf result of a rml report

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 2012-12-18 11:50:43 +0000
3+++ openerp/report/render/rml2pdf/trml2pdf.py 2013-03-19 10:22:55 +0000
4@@ -742,7 +742,11 @@
5 if extra_style:
6 style.__dict__.update(extra_style)
7 result = []
8- for i in self._textual(node).split('\n'):
9+ textuals = self._textual(node).split('\n')
10+ keep_empty_lines = (len(textuals) > 1) and len(node.text.strip())
11+ for i in textuals:
12+ if keep_empty_lines and len(i.strip()) == 0:
13+ i = '<font color="white"> </font>'
14 result.append(platypus.Paragraph(i, style, **(utils.attr_get(node, [], {'bulletText':'str'}))))
15 return result
16 elif node.tag=='barCode':