تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
21395 أدوات العرض

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)


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
3
أكتوبر 23
7854
1
سبتمبر 23
2872
1
مايو 23
1864
2
أبريل 23
2407
1
مارس 23
1809