For example, to replace the native invoice report by a custom py3o
report, add the following XML file in your custom module:
`` ` py3o odt my_custom_module_base report/account_invoice.odt ``\`
where *my_custom_module_base* is the name of the custom Odoo module. In
this example, the invoice ODT file is located in
*my_custom_module_base/report/account_invoice.odt*.
It's also possible to reference a template located in a trusted path of
your Odoo server. In this case you must let the *module* entry empty and
specify the path to the template as *py3o_template_fallback*.
`` ` py3o odt /odoo/templates/py3o/report/account_invoice.odt ``\`
Moreover, you must also modify the Odoo server configuration file to
declare the allowed root directory for your py3o templates. Only
templates located into this directory can be loaded by py3o report.
`` ` [options] ... [report_py3o] root_tmpl_path=/odoo/templates/py3o ``\`
If you want an invoice in PDF format instead of ODT format, the XML file
should look like:
`` ` py3o pdf my_custom_module_base report/account_invoice.odt ``\`
If you want to add a new py3o PDF report (and not replace a native
report), the XML file should look like this:
`` ` Partner Summary res.partner res.partner.summary py3o pdf my_custom_module_base report/partner_summary.odt report ``\`
\## Configuration parameters
py3o.conversion_command The command to be used to run the conversion,
libreoffice by default. If you change this, whatever you set here must
accept the parameters --headless --convert-to \$ext \$file and put the
resulting file into \$file's directory with extension \$ext. The command
will be started in \$file's directory.