Q: Odoo QWeb report page counter on page
Asked Answered
W

2

7

How can you display the page count outside the footer?

Hey,

I'm building a report for a customer. All is fine except that he wants to display the page number on the page (near the address field) instead of the footer, which is not working at all.

As I understand this so far, the subst.js used in the report module is responsible for replacing the page and topage classes with the page numbers.

The subst.js is called in the report/minimal_layout template, if subst is True. The boolean value is set in the report.py in the get_pdf method for the header and footer to True, while it is false for the reportcontent. If I'm applying bad practice and edit the Odoo core and set subst=True for reportcontent, the report engine does not render the body part of the report anymore and returns undefined.

Did anyone found a suitable solution for this problem?

Wallflower answered 28/9, 2015 at 15:22 Comment(1)
Does it possible to add you attempt you have tried with the code ? please try to add it with your question.Intervention
D
1

Simply put this snippet where you want to display page count.

<ul class="list-inline">
    <li>Page:</li>
    <li><span class="page"/></li>
    <li>/</li>
    <li><span class="topage"/></li>
</ul>
Daradarach answered 13/11, 2018 at 6:7 Comment(0)
K
0

try this

<t t-set="nbr_page" t-value="0"/>  <p> <t t-set="compteur" t-value="nbr_page+1"/><t t-esc="nbr_page"/> </p> </t>
Kwh answered 9/3, 2016 at 9:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.