diff --git a/account_financial_report/report/abstract_report_xlsx.py b/account_financial_report/report/abstract_report_xlsx.py index fb99d7cc..d4a867c6 100644 --- a/account_financial_report/report/abstract_report_xlsx.py +++ b/account_financial_report/report/abstract_report_xlsx.py @@ -2,9 +2,11 @@ # Author: Julien Coux # Copyright 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import models import datetime +from odoo.tools import format_date + class AbstractReportXslx(models.AbstractModel): _name = 'report.account_financial_report.abstract_report_xlsx' @@ -190,7 +192,7 @@ class AbstractReportXslx(models.AbstractModel): for col_pos, column in self.columns.items(): value = getattr(line_object, column['field']) if isinstance(value, datetime.date): - value = fields.Date.to_string(value) + value = format_date(self.env, value) cell_type = column.get('type', 'string') if cell_type == 'many2one': self.sheet.write_string(