Repository
OCA/reporting-engine · module folder · Try on Runboat
Module version
1.0.1
Category
Reporting
Folder size
0.37 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
Odoo Community Association (OCA), Avoin.Systems, Tecnativa
Maintainers
Odoo Community Association (OCA), Avoin.Systems, Tecnativa
Committers
Laurent Mignon (ACSONE), Enric Tobella, Weblate, OCA-git-bot, oca-ci
Odoo dependencies
odoo/odoo:
- web
Python dependencies
None
System dependencies
None
Required by
l10n_es_facturae
Description
This module was written to extend the functionality of the reporting
engine to support XML reports and allow modules to generate them by code
or by QWeb templates.

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
demo_report_xml_view demo_report_xml_view ir.ui.view qweb New
ir_actions_report_view_form_report_xml ir.actions.report.view.form.report.xml ir.actions.report form Inherits base.act_report_xml_view
HTTP endpoints (2)
Route(s)HandlerAuthTypeMethodsFlags
(inherited route override) ReportController.report_download inherited http ALL
(inherited route override) ReportController.report_routes inherited http ALL
Models touched (2)

New fields (5)
  • report_type Selection
    ondelete={'qweb-xml': 'set default'} selection_add=[('qweb-xml', 'XML')]
  • xml_declaration Boolean
    help='Add `<?xml encoding="..." version="..."?>` at the start of final report file.' string='XML Declaration'
  • xml_encoding Selection
    help='Encoding for XML reports. If nothing is selected, then UTF-8 will be applied.' selection=[('UTF-8', 'UTF-8')] string='XML Encoding'
  • xml_extension Char
    default='xml' help='Extension for XML Reports, by default is `xml`'
  • xsd_schema Binary
    attachment=True help='File with XSD Schema for checking content of result report. Can be empty if validation is not required.' string='XSD Validation Schema'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (2)
  • generate_report(self, ir_report, docids, data=None)
    @api.model
    Generate and validate XML report. Use incoming `ir_report` settings to setup encoding and XMl declaration for result `xml`. Methods: * `_get_rendering_context` `ir.actions.report` - get report variables. It will call `_get_report_values` of report's class if it's exist. * `render_template` of `ir.actions.report` - get report content * `validate_report` - check result content Args: * ir_report(`ir.actions.report`) - report definition instance in Odoo * docids(list) - IDs of instances for those report will be generated * data(dict, None) - variables for report rendering Returns: * str - result content of report * str - `"xml"` Extra Info: * Default encoding is `UTF-8`
  • validate_report(self, xsd_schema_doc, content)
    @api.model
    Validate final report content against value of `xsd_schema` field ("XSD Validation Schema") of `ir.actions.report` via `etree` lib. Args: * xsd_schema_doc(byte-string) - report validation schema * content(str) - report content for validation Raises: * odoo.exceptions.ValidationError - Syntax of final report is wrong Returns: * bool - True

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…