Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Print Invoice with 10 lines per pages

By
isio-odoo
on 7/13/16, 9:42 AM 411 views

Hi,

How i can print invoice with limited number of rows per page

for exemple , i have a invoice order with 50 lines i want to print 20 lines per page

mean my printed pdf document will be in 3 pages in this case

Thank you


1

Axel Mendoza

--Axel Mendoza--
10205
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 7/14/16, 1:01 AM

You could do it like this :(always is better if you post your code so we don't need to create an example)

<div t-if="line_index % 20 == 0" style="page-break-after: always;">
  <br/>
</div>

Just include that code in your report inside the foreach of the lines, set the var name of the foreach loop instead of the bold line in the above 

t-if="line_index % 20 == 0"

That will cause to insert a page break every 20 lines

0
isio-odoo
On 7/14/16, 12:52 PM

this is my code

<table width="100%">

<tr t-foreach="o.invoice_line" t-as="l" class="tr" height="30" >

<td width="13%"><span t-field="l.product_id.default_code"/></td>

<td width="39%" class="text-left"><span t-field="l.product_id.name"/></td>

<td width="14%" class="text-left"><span t-field="l.name"/></td>

<td width="7%" class="text-left"><span t-field="l.quantity" t-field-options="{&quot;widget&quot;: &quot;integer&quot;,&quot;digits&quot;:0}"/></td>

<td width="8%" class="text-left"><span t-field="l.uos_id"/></td>

<td width="8%" class="text-left"><span t-field="l.price_unit"/></td>

<td width="9%" class="text-right">

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

</td> 

</tr>

</table>



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/13/16, 9:42 AM
Seen: 411 times
Last updated: 7/14/16, 12:52 PM