Search code examples
docxodoo-12

Odoo 12 : Got FileNotFoundError when printing docx/pdf/doc using py3o_report



It is the first time that I use py3o_report in Odoo. I was printing a docx format and got error like these. Seems that, it can not find the generated document in /tmp. But it's work perfectly when I generate .odt (natif format)
Here is my code :

<odoo>

<report
        id="my_module.action_report_hr_expense"
        string="Expense"
        model="hr.expense"
        name="my_module.hr_expense_report"
        report_type="qweb-pdf"
/>
<record id="my_module.action_report_hr_expense" model="ir.actions.report">
    <field name="type">ir.actions.report</field>
    <field name="report_type">py3o</field>
    <field name="py3o_filetype">docx</field>
    <field name="module">my_module</field>
    <field name="py3o_multi_in_one">True</field>
    <field name="py3o_template_fallback">hr_expense.odt</field>
</record>
</odoo>

Solution

  • I don't know if it is a bug, but when I close all the writer documents and then print .docx document, I don't get any errors.