[FIX] encoding and mime type for excel export files
bzr revid: xmo@openerp.com-20110829122718-y51ynodvlnkaixms
This commit is contained in:
parent
bf4e7856b6
commit
bf83005072
|
@ -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"
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue