Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5023 Visualizzazioni

I am using module "Base report xlsx" and xlsxwriter to write a report xlsx. But i have a problem about translate data. I alr use _() method and translate it in my language (vi.po -vietnamese) like: 

title_line_format = workbook.add_format({'bold': True, 'font_size': 20, 'align': 'center'})

data = _("Procurement List Report")

sheet.merge_range('A1:N3', data, title_line_format)

But when i export, my file still be written by english . Am i wrong? Can anyone explain why it didin't work?

Thanks and Regards,

Minh


Avatar
Abbandona
Risposta migliore

It seems the lang context is lost when using report_xlsx

You can force the language on the report.py


e.g.

def generate_xlsx_report(self, workbook, data, products):
#force language
self = self.with_context(lang=self.env.user.lang)
Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
dic 24
1445
2
feb 24
2964
4
nov 23
3409
1
ago 22
3707
2
lug 22
9189