Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
21573 Weergaven

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
Annuleer

Thanks Niyas and Sudhir

Beste antwoord

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
3
okt. 23
8418
1
sep. 23
3182
1
mei 23
2114
2
apr. 23
2629
1
mrt. 23
2041