Odoo Help

1

0
4 Answers
0
Rui Franco
5/9/18, 3:16 AM

Thanks Jake Robinson but, by "code" I mean "python". I need to be able to do this using python.


Call a report and get the attachment (or create it).

0
Jake Robinson
5/9/18, 3:02 AM

If you are defining your report using the <report/>, see the following example:

<report id="l10n_ch_isr_report"
    model="account.invoice"
    report_type="qweb-pdf"
    string="ISR"
    name="l10n_ch.isr_report_main"
    file="l10n_ch.isr_report_main"
attachment="'ISR-' + object.number + '.pdf'"/>

 The attachment attribute will give the file a name and store it as an attachment.

You can also configure this in the UI by going to Settings -> Technical -> Reports, selecting the correct report and clicking the Advanced Properties tab. The attachment field is editable here. Note: you must be in developer mode to see these menus.

Ask a Question
Writer
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now