From 3b824c76e9dcd44d49369e48b7be686d1fd9287f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 30 Aug 2011 15:43:05 +0200 Subject: [PATCH] [FIX] don't coerce values to str before writing them to the worksheet in excel export especially since xlwt is perfectly able to deal with unicode instances without blowing up like a 'tard bzr revid: xmo@openerp.com-20110830134305-iu354whbr0c0kvpw --- addons/base/controllers/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/base/controllers/main.py b/addons/base/controllers/main.py index ab583d9831c..85f8e7742e4 100644 --- a/addons/base/controllers/main.py +++ b/addons/base/controllers/main.py @@ -1308,8 +1308,8 @@ class ExcelExport(Export): for row_index, row in enumerate(rows): for cell_index, cell_value in enumerate(row): - cell_value = str(cell_value) - cell_value = re.sub("\r", " ", cell_value) + if isinstance(cell_value, basestring): + cell_value = re.sub("\r", " ", cell_value) worksheet.write(row_index + 1, cell_index, cell_value, style) fp = StringIO()