Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
6390 Vistas
odoo 13 change date format overridden controllers below class and init method,
Changes not reflected.


from odoo.addons.web.controllers.main import ExportXlsxWriter


class ExportXlsxWriter(ExportXlsxWriter):

def __init__(self, fields, row_count=0):
super(ExportXlsxWriter, self).__init__(fields, row_count=row_count)
self.date_style = self.workbook.add_format({'text_wrap': True, 'num_format': 'mm-dd-yyyy'})

Odoo old to new all versions export date format change or set in user interface feature not available.
Is any custom module available export data date format and float_time widget change from user interface? or any plan to add this feature in the latest odoo 14 version.
Avatar
Descartar

I experience the exact same problem. Why is this format fixed and not aligned with user settings for language in Odoo or Excel ?

Mejor respuesta
def __myinit__(self, field_names, row_count=0):
self.field_names = field_names
self.output = io.BytesIO()
...

ExportXlsxWriter.__init__ = __myinit__


Avatar
Descartar
Mejor respuesta
just add format_date(self.env,date),'num_format': 'dd-mm-yyyy'},


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
4
ago 24
76051
2
may 25
1364
0
oct 23
2506
2
oct 23
2218
0
sept 23
1125