From 1de14e18c5ae77fdab317aa0490f3def88ef5ae2 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 3 Feb 2009 15:08:30 +0100 Subject: [PATCH] [FIX] Decode to utf-8 [IMP] Don't compute twice the xml stream lp bug: https://launchpad.net/bugs/324759 fixed bzr revid: stephane@tinyerp.com-20090203140830-ij2s919zywxs9fvi --- addons/base_module_record/base_module_record.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/base_module_record/base_module_record.py b/addons/base_module_record/base_module_record.py index fa9c8a6b51f..9cfa5058031 100644 --- a/addons/base_module_record/base_module_record.py +++ b/addons/base_module_record/base_module_record.py @@ -182,7 +182,7 @@ class base_module_record(osv.osv): val = str(val) val = val and ('"""%s"""' % val.replace('\\', '\\\\').replace('"', '\"')) or 'False' - field.setAttribute(u"eval", val) + field.setAttribute(u"eval", val.decode('utf-8')) record.appendChild(field) return record_list, noupdate @@ -324,8 +324,8 @@ class base_module_record(osv.osv): data.appendChild(res) elif rec[0]=='assert': pass - res = doc.toprettyxml(indent="\t") - return doc.toprettyxml(indent="\t").encode('utf8') + + return doc.toprettyxml(indent="\t").encode('utf-8') base_module_record() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: