Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
21579 Переглядів

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)


Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
3
жовт. 23
8445
1
вер. 23
3189
1
трав. 23
2126
2
квіт. 23
2640
1
бер. 23
2059