I would like to know how can I download/print a single pdf that has multiple reports of the same template.
At the moment I can download only a single report per child, but I want to have them all in a single pdf when I print them from the parent. In my views I use buttons in the header to get the report.
<header> <button name="%(action_report_salary_all_details)d" string="Salary (details)" type="action" style="margin-right: 5px;"/> <button name="%(action_report_salary_few_details)d" string="Salary" type="action"/> </header>
My report code for the child model (parent is 'hr.history.salary' and it is in One2Many relation with child):
class ReportSalaryFewDetails(models.AbstractModel):
_name = 'report.hr.report_salary_few_details'
@api.model
def render_html(self, docids, data=None):
payslips = self.env['hr.history.salary.salary_slips'].browse(docids)
docargs = {
'doc_ids': docids,
'doc_model': 'hr.history.salary.salary_slips',
'docs': payslips,
'data': data,
}
return self.env['report'].render('my_addon.report_salary_few_details', docargs)
Do I have to create a whole new report so I can call it from the parent or can I modify this code and how to print them all in one pdf?