tinyerp / erppeek

A versatile tool for Odoo / OpenERP. *** Forked as Odooly ⟶
https://github.com/tinyerp/odooly
Other
171 stars 99 forks source link

unicode representation for record #74

Closed xblitz closed 9 years ago

xblitz commented 9 years ago

example: direct printing of a record that has unicode data:

print record
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128)

since the Record does not implement unicode and data received by the server (xmlrpc) is in unicode (utf8)

i think the code in Record should look like

def __unicode__(self):
    return self._name

def __str__(self):
    return self._name.encode('ascii', 'replace')
florentx commented 9 years ago

thank you.

I will adapt to support 2.7 and 3.x ...

Interesting reading .... http://kmike.ru/python-with-strings-attached/

florentx commented 9 years ago

I've merged the fix for 1.6.2