首页 文章

问:页面上有Odoo QWeb报告页面计数器

提问于
浏览
5

How can you display the page count outside the footer?

嘿,

我正在为客户 Build 一份报告 . 一切都很好,除了他想在页面上显示页码(在地址栏附近)而不是页脚,这根本不起作用 .

据我所知,到目前为止,报告模块中使用的subst.js负责用页码替换 pagetopage 类 .

如果 subst is True ,则在report / minimal_layout模板中调用subst.js . get_pdf 方法的report.py中的页眉和页脚的 True 设置了布尔值,而 reportcontent 则为false . 如果我正在应用不良做法并编辑Odoo核心并为 reportcontent 设置 subst=True ,则报表引擎不再呈现报表的正文部分并返回undefined .

有没有人为这个问题找到合适的解决方案?

2 回答

  • 0

    试试这个

    <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

    只需将此代码段放在要显示页数的位置即可 .

    <ul class="list-inline">
        <li>Page:</li>
        <li><span class="page"/></li>
        <li>/</li>
        <li><span class="topage"/></li>
    </ul>
    

相关问题