[FIX] Custom Object xml arch needed encoding.
authorJay (Open ERP) <jvo@tinyerp.com>
Wed, 25 Nov 2009 09:35:04 +0000 (15:05 +0530)
committerJay (Open ERP) <jvo@tinyerp.com>
Wed, 25 Nov 2009 09:35:04 +0000 (15:05 +0530)
lp bug: https://launchpad.net/bugs/487836 fixed

bzr revid: jvo@tinyerp.com-20091125093504-2tdb5sx3hltpxnjq

bin/addons/base/ir/ir_translation.py
bin/osv/orm.py

index b90fe79..8d4959f 100644 (file)
@@ -133,14 +133,14 @@ class ir_translation(osv.osv):
                         'and type=%s ' \
                         'and name=%s ' \
                         'and src=%s',
-                    (lang, tt, str(name), source))
+                    (lang, tt, tools.ustr(name), source))
         else:
             cr.execute('select value ' \
                     'from ir_translation ' \
                     'where lang=%s ' \
                         'and type=%s ' \
                         'and name=%s',
-                    (lang, tt, str(name)))
+                    (lang, tt, tools.ustr(name)))
         res = cr.fetchone()
         trad = res and res[0] or ''
         return trad
index 3200611..c8469c1 100644 (file)
@@ -1326,7 +1326,7 @@ class orm_template(object):
                 xml = self.__get_default_calendar_view()
             else:
                 xml = ''
-            result['arch'] = etree.fromstring(xml)
+            result['arch'] = etree.fromstring(encode(xml))
             result['name'] = 'default'
             result['field_parent'] = False
             result['view_id'] = 0