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

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!!!!!!!

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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'
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มิ.ย. 20
4095
1
มี.ค. 19
3970
Hide menu for all except specific group แก้ไขแล้ว
1
พ.ย. 22
3458
Live tracking in odoo. แก้ไขแล้ว
2
ส.ค. 22
7844
1
ม.ค. 25
9516