Repository
OCA/reporting-engine · module folder · Try on Runboat
Module version
1.0.0
Category
Reporting
Folder size
0.83 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/reporting-engine
Last tracking update
2026-08-07 09:06:34
Authors
ACSONE SA/NV, Odoo Community Association (OCA), XCG Consulting
Maintainers
ACSONE SA/NV, Odoo Community Association (OCA), XCG Consulting
Committers
Weblate, OCA-git-bot, oca-ci, kopeyev
Odoo dependencies
odoo/odoo:
- web
Python dependencies
py3o.formats, py3o.template
System dependencies
libreoffice
Required by
survey_certification_py3o
Description
The py3o reporting engine is a reporting engine for Odoo based on
\[Libreoffice\](<http://www.libreoffice.org/>):

- the report is created with Libreoffice (ODT or ODS),
- the report is stored on the server in OpenDocument format (.odt or
  .ods file)
- the report is sent to the user in OpenDocument format or in any output
  format supported by Libreoffice (PDF, HTML, DOC, DOCX, Docbook, XLS,
  etc.)

The key advantages of a Libreoffice based reporting engine are:

- no need to be a developer to create or modify a report: the report is
  created and modified with Libreoffice. So this reporting engine has a
  full WYSIWYG report development tool!
- For a PDF report in A4/Letter format, it's easier to develop it with a
  tool such as Libreoffice that is designed to create A4/Letter
  documents than to develop it in HTML/CSS, also some print
  peculiarities (backgrounds, margin boxes) are not very well supported
  by the HTML/CSS based solutions.
- If you want your users to be able to modify the document after its
  generation by Odoo, just configure the document with ODT output (or
  DOC or DOCX) and the user will be able to modify the document with
  Libreoffice (or Word) after its generation by Odoo.
- Easy development of spreadsheet reports in ODS format (XLS output
  possible).

This module *report_py3o* is the base module for the Py3o reporting
engine. If used alone, it will spawn a libreoffice process for each ODT
to PDF (or ODT to DOCX, ..) document conversion. This is slow and can
become a problem if you have a lot of reports to convert from ODT to
another format. In this case, you should consider the additionnal module
*report_py3o_fusion_server* which is designed to work with a libreoffice
daemon. With *report_py3o_fusion_server*, the technical environnement is
more complex to setup because you have to install additionnal software
components and run 2 daemons, but you have much better performances and
you can configure the libreoffice PDF export options in Odoo (allows to
generate PDF forms, PDF/A documents, password-protected PDFs,
watermarked PDFs, etc.).

This reporting engine is an alternative to
\[Aeroo\](<https://github.com/aeroo-community/aeroo_reports>): these two
reporting engines have similar features but their implementation is
entirely different. You cannot use aeroo templates as drop in
replacement though, you'll have to change a few details.

Code Analysis

Views touched (5)
XML IDNameModelTypeStatus
act_report_xml_search_view py3o_report_search_view ir.actions.report search Inherits base.act_report_xml_search_view
py3o_report_view py3o_report_view ir.actions.report Inherits base.act_report_xml_view
py3o_template_configuration_form_view py3o.template.configuration.form.view py3o.template form New
py3o_template_configuration_search_view py3o.template.configuration.search.view py3o.template search New
py3o_template_configuration_tree_view py3o.template.configuration.tree.view py3o.template list New
HTTP endpoints (2)
Route(s)HandlerAuthTypeMethodsFlags
(inherited route override) ReportController.report_download inherited http ALL
(inherited route override) ReportController.report_routes inherited http ALL sudo
Models touched (3)

New fields (10)
  • is_py3o_native_format Boolean
    compute='_compute_is_py3o_native_format'
  • is_py3o_report_not_available Boolean
    compute='_compute_py3o_report_not_available'
  • lo_bin_path Char
    compute='_compute_lo_bin_path' string='Path to the libreoffice runtime'
  • module Char
    help='The implementer module that provides this report'
  • msg_py3o_report_not_available Char
    compute='_compute_py3o_report_not_available'
  • py3o_filetype Selection
    selection='_get_py3o_filetypes' string='Output Format'
  • py3o_multi_in_one Boolean
    help='If you execute a report on several records, by default Odoo will generate a ZIP file that contains as many files as selected records. If you enable this option, Odoo will generate instead a single report for the selected records.' string='Multiple Records in a Single Report'
  • py3o_template_fallback Char
    help='If the user does not provide a template this will be used it should be a relative path to root of YOUR module or an absolute path on your server.' size=128 args: 'Fallback'
  • py3o_template_id Many2one → py3o.template
    args: 'py3o.template', 'Template'
  • report_type Selection
    ondelete={'py3o': 'cascade'} selection_add=[('py3o', 'py3o')]
Public methods (2)
  • gen_report_download_filename(self, res_ids, data)
    Override this function to change the name of the downloaded report
  • get_from_report_name(self, report_name, report_type)
    @api.model

New fields (1)
  • ir_actions_report_id Many2one → ir.actions.report
    comodel_name='ir.actions.report' required=True
Public methods (2)
  • create_report(self, res_ids, data)
    Override this function to handle our py3o report
  • get_template(self, model_instance)
    private helper to fetch the template data either from the database or from the default template file provided by the implementer. ATM this method takes a report definition recordset to try and fetch the report template from database. If not found it will fallback to the template file referenced in the report definition. @returns: string or buffer containing the template data @raises: TemplateNotFound which is a subclass of odoo.exceptions.DeferredException

New fields (3)
  • filetype Selection
    default='odt' required=True selection=[('odt', 'ODF Text Document'), ('ods', 'ODF Spreadsheet'), ('odp', 'ODF Presentation'), ('fodt', 'ODF Text Document (Flat)'), ('fods', 'ODF Spreadsheet (Flat)'), ('fodp', 'ODF Presentation (Flat)')] string='LibreOffice Template File Type'
  • name Char
    required=True string='Template name'
  • py3o_template_data Binary
    args: 'LibreOffice Template'
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…