I'm trying to create a report that uses some computed values that it gets from a few different models and than save it in a binary field. All other models that are needed are in relation with the one from which I call the get_pdf so that I gave it the current id.
document = self.env['report'].sudo().get_pdf(self.id, 'report_my_report')
My report code
class ReportMyReport(models.AbstractModel): _name = 'report.hr.report_my_report' @api.model def render_html(self, docids, data=None): data = self.env['hr.obrazec.obracun.place'].get_report_data(docids) docargs = { 'doc_ids': self.ids, 'doc_model': self.model, 'data': data, } return self.env['report'].render('hr_izracun_place.report_my_report', docargs)
The get_report_data is a method from an AbstractModel that computes all the data needed and returns it in a dict?
It takes the id from my top model.
So my problem is that I don't know if this is even the correct way of doing it. And it just won't work! So can some one please help with this and I'd like to know how to use the custom data in the QWEB report.
THANKS!