[FIX] If RML contains unicode characters and title in the same <para>,it would have failed.

lp bug: https://launchpad.net/bugs/507429 fixed

bzr revid: jvo@tinyerp.com-20100118093815-jkq0e0u09kx4x7hn
This commit is contained in:
Jay (Open ERP) 2010-01-18 15:08:15 +05:30
parent b3dd6bad34
commit 28f42a58ec
1 changed files with 4 additions and 1 deletions

View File

@ -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