Skip to Content
Menú
This question has been flagged
3 Respostes
21365 Vistes

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 :)

Avatar
Descartar

Thanks Niyas and Sudhir

Best Answer

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

Avatar
Descartar
Best Answer

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)


Avatar
Descartar
Related Posts Respostes Vistes Activitat
3
d’oct. 23
7770
1
de set. 23
2827
1
de maig 23
1813
2
d’abr. 23
2333
1
de març 23
1758