From 7e4e42c34a0ca833f792bf3a2ff1d4bac125f287 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 19 Jan 2009 11:08:46 +0100 Subject: [PATCH 1/2] [FIX] Encoding error bzr revid: stephane@tinyerp.com-20090119100846-x4fp20cax93a4zf8 --- bin/osv/orm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 61b379f5311..cc548bb11fe 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -443,7 +443,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): From f987f9cccbc0aabd3613b80e5c6e44c47c90b5ab Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 19 Jan 2009 11:12:01 +0100 Subject: [PATCH 2/2] [FIX] Store the string type function field (patch from Xavier ALT (AJM)) lp bug: https://launchpad.net/bugs/318543 fixed bzr revid: stephane@tinyerp.com-20090119101201-20n79r2agfo03w36 --- bin/osv/orm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index cc548bb11fe..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)))