Merge lp:~therp-nl/ocb-server/7.0_lp1260743_print_empty_lines into lp:ocb-server

Proposed by Ronald Portier (Therp)
Status: Merged
Merged at revision: 5211
Proposed branch: lp:~therp-nl/ocb-server/7.0_lp1260743_print_empty_lines
Merge into: lp:ocb-server
Diff against target: 19 lines (+7/-2)
1 file modified
openerp/report/render/rml2pdf/trml2pdf.py (+7/-2)
To merge this branch: bzr merge lp:~therp-nl/ocb-server/7.0_lp1260743_print_empty_lines
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Olivier Laurent (Acsone) (community) Approve
Stefan Rijnhart (Opener) Approve
Pedro Manuel Baeza code review Approve
Lara (Therp) (community) test Approve
Review via email: mp+199108@code.launchpad.net

Description of the change

Fixes lp1260743: empty lines are not printed.

To post a comment you must log in.
5192. By Ronald Portier (Therp)

[FIX] Fixes lp1260743: empty lines are not printed.
    Extra formatting improvement keeps this fix in line with proposed
    merge on standard openerp branch, to prevent conflict when/if merge
    on standard accepted.

Revision history for this message
Lara (Therp) (lfreeke) wrote :

Tested and approved

review: Approve (test)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM

review: Approve (code review)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks! This actually improves on https://code.launchpad.net/~olivier-laurent/openobject-server/6.1-bug1157048/+merge/154031, which either only works in other cases or has only worked before.

I'm hesitant about the changes in whitespace. I know that the OpenERP core dev team does not like unnecessary changes, so to increase the chances of this change being merged in upstream, I would like to ask you to remove them.

review: Needs Fixing
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Sorry, I'm taking my objection back. I had not noticed that the code that you improved is actually touched in the change to upstream, which warrants the refactoring.

review: Approve
Revision history for this message
Olivier Laurent (Acsone) (olivier-laurent) wrote :

> Thanks! This actually improves on https://code.launchpad.net/~olivier-laurent
> /openobject-server/6.1-bug1157048/+merge/154031, which either only works in
> other cases or has only worked before.

Just FYI... my proposal was based on reportlab 2.5. A behaviour change in reportlab 2.6 made this proposal without effects !

Tested with the 2 versions of reportlab.

(with version 2.6, "technical" blank lines of the rml template are also removed rendering the pdf result less clear !)

review: Approve
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks Olivier for the clarification!

Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)

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-20 15:12:37 +0000
3+++ openerp/report/render/rml2pdf/trml2pdf.py 2013-12-16 13:05:24 +0000
4@@ -786,8 +786,13 @@
5 keep_empty_lines = (len(textuals) > 1) and len(node.text.strip())
6 for i in textuals:
7 if keep_empty_lines and len(i.strip()) == 0:
8- i = '<font color="white"> </font>'
9- result.append(platypus.Paragraph(i, style, **(utils.attr_get(node, [], {'bulletText':'str'}))))
10+ i = '<font color="white">&nbsp;</font>'
11+ result.append(
12+ platypus.Paragraph(
13+ i, style, **(
14+ utils.attr_get(node, [], {'bulletText':'str'}))
15+ )
16+ )
17 return result
18 elif node.tag=='barCode':
19 try:

Subscribers

People subscribed via source and target branches

to status/vote changes: