Q: Odoo QWeb report page counter per page

How can you display the number of pages outside the footer?

Hey,

I am creating a report for a client. Everything is fine, except that he wants to display the page number on the page (next to the address field) instead of a footer that does not work at all.

As far as I understand, subst.js used in the report module is responsible for replacing classes pageand topagepage numbers.

Sub.js is called in the report / minimum_layout template if subst is True. The boolean value is set in report.py in the method get_pdffor the header and footer to True, and for reportcontent- false. If I use the wrong practice and edit the Odoo kernel and install subst=Truefor reportcontent, the reporting engine no longer displays the main part of the report and returns undefined.

Has anyone found a suitable solution for this problem?

+4
source share
1 answer

try it

<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>
0
source

Source: https://habr.com/ru/post/1609337/


All Articles