简体   繁体   中英

How to get number of line in page qweb report. Odoo 11

I want to add condition in report qweb (invoice report) according to number of line in page. How can I get number of line in each page in report?

 <body class="container">
                <div id="wrapwrap">
                    <main>
                        <t t-raw="0"/>
                        <t t-if="counter == 10">
                            <p style="page-break-after:always;">Add some code</p>
                            <t t-set="counter" t-value="0"/>
                        </t>
                        <t t-set="counter" t-value="counter + 1"/>
                    </main>
                </div>
            </body>

Thanks.

Sorry I'm late.

You can use "line_index" in order to get what you want. This is way simpler than creating a variable on the qweb.

<t t-if="line_index == 4">
    <p style="page-break-after:always;"/>
</t>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM