Browse Source

[FIX] account_financial_report; Add format to date fields

pull/717/head
SimoRubi 4 years ago
parent
commit
21b8d3ee7b
  1. 6
      account_financial_report/report/abstract_report_xlsx.py

6
account_financial_report/report/abstract_report_xlsx.py

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

Loading…
Cancel
Save