0

I modified invoice report template "account.report_invoice_document".

XML Code:

<template id="report_invoice_document_inherit" inherit_id="account.report_invoice_document">
    <xpath expr="//div[@class='page']" position="inside">
        <div class="row">
            <div class="text-left">
                <h4><u>Comments</u></h4>
            </div>
            <div class="text-justify" style="margin-left:10px;">
                <p>Data</p>
            </div>
        </div>
    </xpath>
</template>

No Error display on Terminal when I tried to download multiple invoices.

Invoice Report successfully downloaded when it is download from form view.An error has occurred when multiple report download from an account.invoice tree view

I got an error on odoo.

 Error:
    Odoo Server Error

    Traceback (most recent call last):
      File "/home/odoo/Documents/odoo11_community/odoo-11.0/addons/web/controllers/main.py", line 1663, in report_download
        response = self.report_routes(reportname, docids=docids, converter='pdf')
      File "/home/odoo/Documents/odoo11_community/odoo-11.0/odoo/http.py", line 512, in response_wrap
        response = f(*args, **kw)
      File "/home/odoo/Documents/odoo11_community/odoo-11.0/addons/web/controllers/main.py", line 1612, in report_routes
        pdf = report.with_context(context).render_qweb_pdf(docids, data=data)[0]
      File "/home/odoo/Documents/odoo11_community/odoo-11.0/odoo/addons/base/ir/ir_actions_report.py", line 641, in render_qweb_pdf
        return self._post_pdf(save_in_attachment, pdf_content=pdf_content, res_ids=html_ids), 'pdf'
      File "/home/odoo/Documents/odoo11_community/odoo-11.0/odoo/addons/base/ir/ir_actions_report.py", line 524, in _post_pdf
        assert len(outlines_pages) == len(res_ids)
    AssertionError
Ketan Chauhan
  • 153
  • 1
  • 8

1 Answers1

0

try to replace the line:

<h4><u>Comments</u></h4>

by:

<p><u>Comments</u></p>

The problem is th <h4> tag.

The source code in Odoo 11 (odoo/addons/base/ir/ir_actions_report.py) helps:

                # In case of multiple docs, we need to split the pdf according the records.
                # To do so, we split the pdf based on outlines computed by wkhtmltopdf.
                # An outline is a <h?> html tag found on the document. To retrieve this table,
                # we look on the pdf structure using pypdf to compute the outlines_pages that is
                # an array like [0, 3, 5] that means a new document start at page 0, 3 and 5.