Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
21676 Zobrazení

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
Zrušit

Thanks Niyas and Sudhir

Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
říj 23
8773
1
zář 23
3317
1
kvě 23
2257
2
dub 23
2816
1
bře 23
2193