[FIX] encoding and mime type for excel export files

bzr revid: xmo@openerp.com-20110829122718-y51ynodvlnkaixms
This commit is contained in:
Xavier Morel 2011-08-29 14:27:18 +02:00
parent bf4e7856b6
commit bf83005072
2 changed files with 2 additions and 2 deletions

View File

@ -1112,7 +1112,7 @@ def export_xls(fieldnames, table):
data = fp.read()
fp.close()
#return data.decode('ISO-8859-1')
return unicode(data, 'utf-8', 'replace')
return base64.b64encode(data)
class Export(View):
_cp_path = "/base/export"

View File

@ -398,7 +398,7 @@ openerp.base.DataExport = openerp.base.Dialog.extend({
}, function(data) {
var mime = export_format === 'csv'
? 'text/csv;charset=utf8'
: 'application/vnd.mx-excel';
: 'application/vnd.mx-excel;base64';
window.location = 'data:' + mime + ',' + data;
self.close();
});