Merge lp:~therp-nl/ocb-server/6.1_lp1425545_enhanced_flowable_linebreak into lp:ocb-server/6.1

Proposed by Ronald Portier (Therp)
Status: Needs review
Proposed branch: lp:~therp-nl/ocb-server/6.1_lp1425545_enhanced_flowable_linebreak
Merge into: lp:ocb-server/6.1
Diff against target: 35 lines (+6/-12)
1 file modified
openerp/report/render/rml2pdf/trml2pdf.py (+6/-12)
To merge this branch: bzr merge lp:~therp-nl/ocb-server/6.1_lp1425545_enhanced_flowable_linebreak
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) Needs Information
Review via email: mp+250950@code.launchpad.net

Description of the change

Backport report rendering improvement from 7.0

To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

This change looks like a proper backport of the upstream change in https://github.com/OCA/OCB/commit/25f5329deb4068ac737bf7ffdfe54046a46221da + https://github.com/OCA/OCB/commit/c62a75a5f3eb08f5fefe69706858a438361cb73d, except that it undoes the OCB-specific change in http://bazaar.launchpad.net/~ocb/ocb-server/6.1/revision/4324. Is this intentional, i.e. is the fix from rev. 4324 included in the upstream change?

review: Needs Information

Unmerged revisions

4332. By Ronald Portier (Therp)

[FIX] Backport odoo/oca 7.0 rendering fix.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openerp/report/render/rml2pdf/trml2pdf.py'
--- openerp/report/render/rml2pdf/trml2pdf.py 2013-09-10 14:15:41 +0000
+++ openerp/report/render/rml2pdf/trml2pdf.py 2015-02-25 16:10:22 +0000
@@ -32,6 +32,7 @@
32import logging32import logging
33from lxml import etree33from lxml import etree
34import base6434import base64
35from distutils.version import LooseVersion
35from reportlab.platypus.doctemplate import ActionFlowable36from reportlab.platypus.doctemplate import ActionFlowable
36from openerp.tools.safe_eval import safe_eval as eval37from openerp.tools.safe_eval import safe_eval as eval
37from reportlab.lib.units import inch,cm,mm38from reportlab.lib.units import inch,cm,mm
@@ -741,18 +742,11 @@
741 style = self.styles.para_style_get(node)742 style = self.styles.para_style_get(node)
742 if extra_style:743 if extra_style:
743 style.__dict__.update(extra_style)744 style.__dict__.update(extra_style)
744 result = []745 text_node = self._textual(node).strip().replace('\n\n', '\n').replace('\n', '<br/>')
745 textuals = self._textual(node).split('\n')746 instance = platypus.Paragraph(text_node, style, **(utils.attr_get(node, [], {'bulletText':'str'})))
746 keep_empty_lines = (len(textuals) > 1) and len(node.text.strip()) 747 result = [instance]
747 for i in textuals:748 if LooseVersion(reportlab.Version) > LooseVersion('3.0') and not instance.getPlainText().strip() and instance.text.strip():
748 if keep_empty_lines and len(i.strip()) == 0:749 result.append(platypus.Paragraph('&nbsp;<br/>', style, **(utils.attr_get(node, [], {'bulletText': 'str'}))))
749 i = '<font color="white">&nbsp;</font>'
750 result.append(
751 platypus.Paragraph(
752 i, style, **(
753 utils.attr_get(node, [], {'bulletText':'str'}))
754 )
755 )
756 return result750 return result
757 elif node.tag=='barCode':751 elif node.tag=='barCode':
758 try:752 try:

Subscribers

People subscribed via source and target branches

to status/vote changes: