Hi,
In German's Excel Sheets (xls, xlsx) you need to put "," instead of "." as a decimal mark. As a result, csv files also need to look different for Germans to be opened in Excel. The seperator we use to seperate values is ";" instead of "," How do I accomplish this for the Excel Export in OpenERP 7 ?
Regards
Sascha
Im fixing this now by adjusting the neccessary files, so for further reference:
1) First step
addons/web/controllers/main.py
change:
writer = csv.writer(fp, uoting=csv.QUOTE_ALL)
to:
csv_internal_sep = config['csv_internal_sep']
writer = csv.writer(fp, delimiter=csv_internal_sep, quoting=csv.QUOTE_ALL)
2) Second step
server/opener/osv/orm.py
change at the end of __export_row():
def __export_row(self, cr, uid, row, fields, context=None):
[...]
if i == len(f):
if isinstance(r, browse_record):
r = self.pool.get(r._table_name).name_get(cr, uid, [r.id], context=context)
r = r and r[0] and r[0][1] or ''
data[fpos] = tools.ustr(r or '')
return [data] + lines
to
def __export_row(self, cr, uid, row, fields, context=None):
[...]
if i == len(f):
if isinstance(r, browse_record):
r = self.pool.get(r._table_name).name_get(cr, uid, [r.id], context=context)
r = r and r[0] and r[0][1] or ''
data[fpos] = tools.ustr(r or '')
if self.pool.get('res.users').browse(cr, uid, uid).lang == 'de_DE':
if f[i - 1] in self._columns and self._columns[f[i - 1]]._type == 'float' \
or f[i - 1] in self._inherit_fields and self._inherit_fields[f[i - 1]][2]._type == 'float':
data[fpos] = data[fpos].replace(',', '')
data[fpos] = data[fpos].replace('.', ',')
return [data] + lines
Hope this helps whoever runs into the same problem.