In odoo 17, there is a function to download an excel file. This function will call a function to read and write data to my excel file. Initially, I have an excel file and I will read and write data to that file later. Then I will save the file into a binary field and when I press the button it will download the file. Now I want to convert from excel to pdf before downloading, and download a pdf file. Can Odoo do that instead? I have to code the xml report to create a pdf file. The reason I want to convert it is because when customizing the pdf, I have difficulty aligning the column cells with Excel? Hope someone can help me?
'''
def export_payslip(self):
this = self[0]
out = self.create_xlsx_file()
filename = 'phieu_luong.xlsx'
this.export_filename = filename
this.write({'data': out, 'export_filename': filename})
return {
'type': 'ir.actions.act_url',
'name': 'report',
'url': '/web/content/hr.payslip/%s/data/%s?download=true' % (
self.id, self.export_filename),
}
'''