Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1682 Lượt xem

Hi Odoo community,

I made a custom model and i'm trying to print a report of multiple lines. When I select 4 lines for example, when I print the report it prints the 4 lines on the report but creates 4 identical pages.

When I select 6 lines and I do the same, the same thing happens but it creates 6 pages.

Any ideas? Would be a great help if someone could solve this. 😀

Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hi Janiesh, Thanks a lot for your answer. I'm using the SaaS version 15 and Odoo Studio. Where can I test your code?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Coachall,

Please find code in comment. 

I hope this will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Ảnh đại diện
Huỷ bỏ

Please used below code for report template formate.
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="template_id">
<t t-call="report_layout">
<t t-foreach="docs" t-as="o">
<div class="page>
<table>
<thead>
<tr>
<th>Product name</th>
</tr>
<tr t-foreach="line" t-as="o.lines"> #"Add lines loops"
<tr>
<td><sapn t-field="line.product_id.name"/></td>
</tr>
</tr>
</table>
</div>
</t>
</t>
</template>
</data>
</odoo>

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 1 25
4364
3
thg 11 24
30289
1
thg 4 23
2401
0
thg 6 25
7584
1
thg 12 21
2928