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

Hi all! i want a pdf of a tree view but there is no one2many field there for me to loop and print on one page. Right now it gives me a print of  one line each page. Can you help me doing that.

P.s i only want pdf not xls 

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

What is this report for? Means for which model is this report for? Are you printing this report from Form View. Form View takes only current record. From tree view make a for loop to all records of the model.



Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks for answering sir i am so stuck and no one helping!

This report is for custom model "purchase.comp" and its for a tree view. Can you please give me an example of how to make a loop accurately using "purchase.comp".

<t t-call="web.external_layout">

<div class="page">

<table>

<t t-foreach="docs" t-as="o">

<tr>

<td><span t-field="o.id" /></td>

<td><span t-field="o.name" /></td>

<td><span t-field="o.other fields" /></td>

</tr>

</t>

</table>

</div>

</t>

---------

<report

id="action_report_purchase_comp"

string="Purchase Comp Report"

model="purchase.comp"

report_type="qweb-pdf"

name="purchase_comp.report"

file="purchase_comp.report"

print_report_name="'Purchase Com - %s' % (object.id)"

/>

Tác giả

hey man thank you so much you are a life saver and worked like a charm <3

Tác giả

just one think it is printing making pages on the basis of number of lines selected? why is that?

Tác giả

sorry i got it.. i was looping in calling the template too. Thanks man

Yes you are right. Its a standard behavior in odoo. There is a trick to print all rows in your model.

In your tree view on top right where it show pagination like 1-80. Click on it, its editable and change it from 1-80 to 1-1000.

Select and print you new range..

Tác giả

man i didn't know that. That is very informative ! (y) i cant thank you enough actually

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 19
2896
2
thg 7 18
10143
0
thg 4 24
1826
0
thg 6 20
2583
1
thg 5 20
9577