From d67eab9c0738265a32d9a3a3c97bf483bec06581 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 26 Dec 2008 14:27:39 +0100 Subject: [PATCH] [FIX] encoding errors lp bug: https://launchpad.net/bugs/31159 fixed bzr revid: christophe@taupe-20081226132739-ty8u9qe32dcu4iyi --- addons/auction/report/huissier.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/addons/auction/report/huissier.py b/addons/auction/report/huissier.py index e01063ba9c0..9afe67834c1 100644 --- a/addons/auction/report/huissier.py +++ b/addons/auction/report/huissier.py @@ -25,9 +25,8 @@ from osv.osv import osv, orm from report.interface import report_rml #FIXME: use the one from tools and delete the one from report from report.int_to_text import int_to_text - -def toxml(val): - return val.replace('&', '&').replace('<','<').replace('>','>').decode('utf-8').encode('latin1', 'replace') +from tools import to_xml as toxml +from tools import ustr class report_custom(report_rml): def __init__(self, name, table, tmpl, xsl): @@ -38,7 +37,7 @@ class report_custom(report_rml): lots = pool.get('auction.lots').browse(cr, uid, ids) auction = lots[0].auction_id - xml = ''' + xml = ''' %s @@ -49,7 +48,7 @@ class report_custom(report_rml): for l in lots: # l['id_cont'] = str(i) if l['obj_price']==0: - price_french = 'retiré' + price_french = u'retiré' else: price_french = int_to_text(int(l['obj_price'] or 0.0))+' eur' i+=1 @@ -59,10 +58,9 @@ class report_custom(report_rml): %s %s %s - ''' % (i, l['obj_num'], toxml(l['name']), price_french, str(l['obj_price'] or '/')) + ''' % (i, l['obj_num'], ustr(toxml(l['name'])), ustr(price_french), ustr(l['obj_price'] or '/')) xml += '' -# file('/tmp/terp.xml','wb+').write(xml) return xml report_custom('report.flagey.huissier', 'auction.lots', '', 'addons/auction/report/huissier.xsl')