From 28f42a58ec7337e5ac2506faf25bb518db30846d Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 18 Jan 2010 15:08:15 +0530 Subject: [PATCH] [FIX] If RML contains unicode characters and title in the same ,it would have failed. lp bug: https://launchpad.net/bugs/507429 fixed bzr revid: jvo@tinyerp.com-20100118093815-jkq0e0u09kx4x7hn --- bin/report/render/rml2pdf/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/report/render/rml2pdf/utils.py b/bin/report/render/rml2pdf/utils.py index bbccd23bb28..a5d141a6c10 100644 --- a/bin/report/render/rml2pdf/utils.py +++ b/bin/report/render/rml2pdf/utils.py @@ -112,6 +112,8 @@ def _process_text(self, txt): try: expr = sps.pop(0) txt = eval(expr,self.localcontext) + if txt and (isinstance(txt, unicode) or isinstance(txt, str)): + txt = self.localcontext.get('translate', lambda x:x)(txt) except Exception,e: tb_s = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)) netsvc.Logger().notifyChannel('report', netsvc.LOG_ERROR, @@ -119,7 +121,8 @@ def _process_text(self, txt): expr.encode('utf-8'))) if type(txt)==type('') or type(txt)==type(u''): txt2 = str2xml(txt) - result += tools.ustr(txt2) + result1 = tools.ustr(txt2) + result = result + str(result1) # To avoid concatenation of unicode and str elif (txt is not None) and (txt is not False): result += str(txt) return result