← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~therp-nl/ocb-server/6.1_lp1260743_print_empty_lines into lp:ocb-server/6.1

 

Ronald Portier (Therp) has proposed merging lp:~therp-nl/ocb-server/6.1_lp1260743_print_empty_lines into lp:ocb-server/6.1.

Requested reviews:
  OpenERP Community Backports Team (ocb)
Related bugs:
  Bug #1260743 in OpenERP Community Backports (Server): "Empty lines in layout of payment reminders are not printed"
  https://bugs.launchpad.net/ocb-server/+bug/1260743

For more details, see:
https://code.launchpad.net/~therp-nl/ocb-server/6.1_lp1260743_print_empty_lines/+merge/199120

Fix lp126043. Print empty lines in rml text blocks.
-- 
https://code.launchpad.net/~therp-nl/ocb-server/6.1_lp1260743_print_empty_lines/+merge/199120
Your team OpenERP Community Backports Team is requested to review the proposed merge of lp:~therp-nl/ocb-server/6.1_lp1260743_print_empty_lines into lp:ocb-server/6.1.
=== modified file 'openerp/report/render/rml2pdf/trml2pdf.py'
--- openerp/report/render/rml2pdf/trml2pdf.py	2012-07-16 07:52:17 +0000
+++ openerp/report/render/rml2pdf/trml2pdf.py	2013-12-16 13:45:56 +0000
@@ -742,8 +742,17 @@
             if extra_style:
                 style.__dict__.update(extra_style)
             result = []
-            for i in self._textual(node).split('\n'):
-                result.append(platypus.Paragraph(i, style, **(utils.attr_get(node, [], {'bulletText':'str'}))))
+            textuals = self._textual(node).split('\n')
+            keep_empty_lines = (len(textuals) > 1) and len(node.text.strip()) 
+            for i in textuals:
+                if keep_empty_lines and len(i.strip()) == 0:
+                    i = '<font color="white">&nbsp;</font>'
+                result.append(
+                    platypus.Paragraph(
+                        i, style, **(
+                            utils.attr_get(node, [], {'bulletText':'str'}))
+                    )
+                )
             return result
         elif node.tag=='barCode':
             try:


Follow ups