Odoo Help


Are page variables available in Qweb template?

Paul Catinean
on 10/27/14, 12:12 PM 2,953 views

Is there a possibility to make conditionals in the template depending on the current page that is being printed in Qweb reports?

e.g: <t t-if="page > 1"> do something that's on other pages except the first </t>

This was available in the header and footer section of report_webkit


Did you finally get a way to detect the page number?

Cyrus Waithaka
on 8/17/15, 1:23 PM

Francesco OpenCode

--Francesco OpenCode--

| 6 8 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 1/8/15, 12:33 PM

page or topage (and other variables) are popolated by javascript in your report. When you put a <span class="page" /> in your report, a js function keep this values from url and put them in the right place. In particulare you can find this function in /addons/report/static/src/js/subst.js.

So it's impossibile to know the value of these variables in your qweb code.

--Ahmed M.Elmubarak--

Ahmed M.Elmubarak
On 2/3/16, 4:14 AM

check this question it may helps

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/27/14, 12:12 PM
Seen: 2953 times
Last updated: 2/3/16, 4:14 AM