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

Hello ALL,

I have created a form in odoo 11 and want all information on that form should be downloaded in PDF and printed after.

I have created a button to print but i know how to get the report action id and how can i create the report action id to be able to work with the button.

Here is the button i have created: <button name="%(print_pdf)d" string="Print" type="action" class="oe_highlight" icon="fa-print"/>


Please help!!!!!!!

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

Hello Niyas,

Thanks for the help but i'm encountering and error when i click on the print button.

AttributeError: type object 'blog.request' has no attribute 'print_request'
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

If you are looking to create a new PDF report in odoo11, you can refer this documentation in the Odoo website: QWeb Reports

If you are looking to download an existing report in a button click see the below sample code ,

In the Python,

@api.multi
def print_quotation(self):
return self.env.ref('sale.action_report_saleorder').report_action(self)

and in the XML,

<button name="print_quotation" string="Print" type="object" states="draft" class="btn-primary o_sale_print"/>

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 6 20
4399
1
thg 3 19
4254
1
thg 11 22
3946
2
thg 8 22
8320
1
thg 1 25
10181