This question has been flagged
2314 Views

how to generate xlsx file on odoo 12.0 using a piece of code that works fine on odoo 11.0
I couldn't find report_xlsx module for odoo 12 anywhere so I installed report_xlsx for odoo 11.0

when I execute the piece of code on Odoo 12.0, nothing happens. no error messages in the logs.

It works fine on odoo 11.0 though.

here is the code:

def print_report_xlsx(self):

active_ids = self.env.context.get('active_ids', [])
data = {
'ids': active_ids,
'model': self.env.context.get('active_model', 'ir.ui.view'),
'form': self.read()[0]
}
    print (data)
return self.env.ref('l10n_gt_extra.action_reporte_banco_xlsx').report_action(self, data=data, config=False)

what should I change to make the code compatible with Odoo 12?


Avatar
Discard