This question has been flagged
2 Replies
7171 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