Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
16905 มุมมอง

I am creating a custom receipt, it's working fine but I need to use a page break.

I have an order with more than 15 order lines, now I want to break the table into two ie, first 10lines should print on the first page and remaining order lines should go to next page.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Shreejith,


You should use a parser and split the data into pieces.

like, data= [[1,2,3],[4,5,6],[7,8,9]]

pass this value to your Qweb.


In your Qweb,
use this idea..not the exact code

<t t-foreach data t-as list>
<table>
      <tbody>
<tr t-foreach list t-as elem>
               <span>......<span>
           </tr>
</tbody>
   </table
   <p style="page-break-after:always;"/>
</t>          
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

If I understood your question correctly, you're trying to limit the amount of records displaying in a tree view.
This topic might help you: https://stackoverflow.com/questions/36887942/odoo-8-tree-view-limit-parameter-not-working

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด


You set a counter variable for t-foreach="" and and give condition inside that.

Break your page if variable value is certain.


For Example

<t t-set="i" t-value="1"/>
<tr t-foreach="o.order_line" t-as="l">
     
<!--Check Condition and break-->
    <td> <span t-esc="i"/></td>
<t t-set="i" t-value="i+1"/>
</tr>

All the Best !!!

อวตาร
ละทิ้ง
ผู้เขียน

I already tried this, but here the whole table is going to next page.

Thanks,

split the table into two.One table in one page and another in another page.

Related Posts ตอบกลับ มุมมอง กิจกรรม
9
ก.พ. 17
6058
Password protect the pdf. แก้ไขแล้ว
4
มิ.ย. 25
8813
PDF reports แก้ไขแล้ว
5
ก.ค. 25
2441
Wrong PDF Format แก้ไขแล้ว
2
มี.ค. 24
2991
0
พ.ย. 22
3134