[MIG] report_csv: Backport from 11.0

This commit is contained in:
Laurent Mignon (ACSONE)
2020-07-29 10:41:37 +02:00
parent 29182742a6
commit 6fb8c68ff9
11 changed files with 144 additions and 73 deletions

View File

@@ -1,17 +1,18 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from io import StringIO
import logging
from StringIO import StringIO
from odoo import models
import logging
_logger = logging.getLogger(__name__)
logger = logging.getLogger(__name__)
try:
import csv
import unicodecsv as csv
except ImportError:
_logger.debug('Can not import csvwriter`.')
logger.debug('Cannot import unicodecsv')
class ReportCSVAbstract(models.AbstractModel):

View File

@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import csv
@@ -17,7 +18,7 @@ class PartnerCSV(models.AbstractModel):
})
def csv_report_options(self):
res = super().csv_report_options()
res = super(PartnerCSV, self).csv_report_options()
res['fieldnames'].append('name')
res['fieldnames'].append('email')
res['delimiter'] = ';'