Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
21580 Vizualizări

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

Imagine profil
Abandonează

Thanks Niyas and Sudhir

Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

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)


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
3
oct. 23
8447
1
sept. 23
3190
1
mai 23
2128
2
apr. 23
2641
1
mar. 23
2060