-
- Downloads
[FIX] base: fix batch report outlines traceback
Steps to reproduce: Accounting app > Customers > Invoices - Create invoice with customer and a couple of products - In the terms & conditions tab at the bottom, add 20-30 empty lines and then a heading (/h1-3) with some text. This insures that the printed report will have more than 1 page. - Go back to the Invoices list view - Select the invoice + another random one > Print > Invoices A traceback appears in _post_pdf: Assertion error `assert len(outlines_pages) == len(res_ids)` When printing a PDF file, `wkhtmltopdf` generates a number of `outlines` equal to the number of headings (`<h1-6>`) in the printed document. When printing multiple documents, the logic requires that each document should have all of its headings on one page. The traceback is raised because one document has headings on more than one page. The information about which `outlines` correspond to which document is lost during the pdf creation process, so there is no easy way to reason about the length of each document after the pdf is created. Solution: If there are more outlines then expected, then the matching fails and each part of the PDF will not be saved as attachment, similarly to https://github.com/odoo/odoo/pull/25496 opw-2882507 closes odoo/odoo#99141 Signed-off-by:Olivier Dony <odo@odoo.com>
Loading
Please register or sign in to comment