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

I want to add a button in a form view, the action of this is to print the report. How can I do this? it seems like printing report in Odoo 12 is far different from Odoo10. can someone have the tutorial for this scenario? Thanks :)

อวตาร
ละทิ้ง

Thanks Niyas and Sudhir

คำตอบที่ดีที่สุด

Hi,

Check the code of the print button added in the sale order form.


See a sample below:

return self.env.ref('test.test_report').report_action(record_id)

in the below image you can see the code of the print button in the sale order form.


Thanks

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

As Niyas said, you can get the reference from the core modules like Sales, Purchase.

Ex:

return self.env.ref('module_name.XML_ID_of_report').report_action(self)


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ต.ค. 23
8769
1
ก.ย. 23
3317
1
พ.ค. 23
2253
2
เม.ย. 23
2808
Inherit Element form kanban View แก้ไขแล้ว
1
มี.ค. 23
2186