diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 61b379f5311..050aba7fdf1 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -281,6 +281,8 @@ def get_pg_type(f): f_type = ('float8', 'DOUBLE PRECISION') elif isinstance(f, fields.function) and f._type == 'selection': f_type = ('text', 'text') + elif isinstance(f, fields.function) and f._type == 'char': + f_type = ('varchar', 'VARCHAR(%d)' % (f.size)) else: logger = netsvc.Logger() logger.notifyChannel("init", netsvc.LOG_WARNING, '%s type not supported!' % (type(f))) @@ -443,7 +445,7 @@ class orm_template(object): break i += 1 if i == len(f): - data[fpos] = str(r or '') + data[fpos] = tools.ustr(r or '') return [data] + lines def export_data(self, cr, uid, ids, fields, context=None):