[FIX] orm: allow unicode in inherit views with attribute
authorkevin wang <kevin_327@163.com>
Mon, 23 Jun 2014 10:48:27 +0000 (12:48 +0200)
committerMartin Trigaux <mat@openerp.com>
Mon, 23 Jun 2014 10:48:27 +0000 (12:48 +0200)
When extending a view with position='attributes', prevent crash if view contains unicode char
Fixes #706

openerp/osv/orm.py

index 1dbac53..fc38169 100644 (file)
@@ -2162,7 +2162,7 @@ class BaseModel(object):
                             node.getparent().remove(node)
                     elif pos == 'attributes':
                         for child in spec.getiterator('attribute'):
-                            attribute = (child.get('name'), child.text and child.text.encode('utf8') or None)
+                            attribute = (child.get('name'), child.text or None)
                             if attribute[1]:
                                 node.set(attribute[0], attribute[1])
                             else: