Skip to Content
Menu
This question has been flagged
2 Replies
7441 Views

I want to limit the number of line items in a table for just 5 items. If the index of the line item reaches 5, the remaining data should print out the next page. Here is what I have so far.

<t t-set="display_discount" t-value="any([l.discount for l in o.invoice_line_ids])"/>

             <table class="table" style="margin-top:84px !important">

                 <tbody class="invoice_tbody">

                    <tr t-foreach="o.invoice_line_ids" t-as="l">

                             

                         <td class="text-left">

                             <span t-field="l.quantity"/>

                             <span t-field="l.uom_id" groups="product.group_uom"/>

                         </td>

                         <td><span t-field="l.name"/></td>

                         <td></td>

                         <td class="text-right">

                             <span t-field="l.price_unit" style="pl8" />

                             <span t-field="l.price_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>

                         </td>

                         <t t-if="l_index == 4">

                            <td style="page-break-inside:always;"> </td>

                        </t>

                      </tr>

                 </tbody>

             </table>

Avatar
Discard

These tips help you to get the basic idea about customization in odoo

https://learnopenerp.tumblr.com/

Best Answer

Hi,

Use Below code for Page Break

<p style="page-break-after:always;"/>

Thanks
Avatar
Discard
Related Posts Replies Views Activity
1
Apr 22
8015
3
Nov 22
7120
0
Nov 18
4025
1
Oct 24
9863
1
Jun 17
10881