I am using version 12, and let's say i have 20 products in invoice and it showed all in one page.
I would like to limit it to 10 products only per page, and the rest will be showed in the next page. I edited report_invoice_document as instructed \here, especially in foreach but entire table is breaking into next page instead.
Edit : Sorry, the anchor link doesn't referring to where it should be. Here's the link :
\https://www.odoo.com/forum/help-1/question/print-invoice-with-10-lines-per-pages-104742
Here is the "clean code" (before I edit it) :
<tbody class="invoice_tbody">
<t t-set="current_subtotal" t-value="0"/>
<t t-foreach="o.invoice_line_ids" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
<tr t-att-class="'bg-100 font-weight-bold' if line.display_type == 'line_section' else 'font-italic' if line.display_type == 'line_note' else ''" style="font-size:14px;">
<t t-if="not line.display_type" name="account_invoice_line_accountable">
<td class="text-center">
<span t-esc="line_index + 1"/>
</td>
<td class="text-center">
<span t-field="line.quantity"/>
</td>
<td class="text-center">
<span t-field="line.uom_id" groups="uom.group_uom"/>
</td>
<td name="account_invoice_line_name"><span t-field="line.name"/></td>
<td class="d-none"><span t-field="line.origin"/></td>
<td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-field="line.price_unit" t-options="{"widget": "monetary", "display_currency": o.currency_id}"/>
</td>
<td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-field="line.discount"/>
</td>
<td class="text-right">
<span t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
<span t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
</td>
</t>
<t t-if="line.display_type == 'line_section'">
<td t-att-colspan="colspan">
<span t-field="line.name"/>
</td>
<t t-set="current_section" t-value="line"/>
<t t-set="current_subtotal" t-value="0"/>
</t>
<t t-if="line.display_type == 'line_note'">
<td t-att-colspan="colspan">
<span t-field="line.name"/>
</td>
</t>
</tr>
<t t-if="current_section and (line_last or o.invoice_line_ids[line_index+1].display_type == 'line_section')">
<tr class="is-subtotal text-right" style="font-size:14px;">
<td t-att-colspan="colspan">
<strong class="mr16">Subtotal</strong>
<span t-esc="current_subtotal" t-options="{"widget": "monetary", "display_currency": o.currency_id}"/>
</td>
</tr>
</t>
</t>
</tbody>
Every suggestion and help is appreciated,
Thanks You!