In Odoo (v9), when I print a report of an individual customer invoice, jasper report works fine. But when I try to print reports of multiple number of customer invoices from the tree view, I get singleton error. Is there something else to be done in ireport for solving this?
Report group is used for solving this. In the .py file of jasper report:
Pass the field by which we want to "group", via the dictionary vals{ }, along with other fields. I used group by "invoice_id".
vals = {'invoice_id' : invoice.id}
Sort the result by "invoice_id" after appending the dictionary.
result.append(vals)
result = sorted(result, key=lambda d: (d['invoice_id']))
return result
In ireport: