Skip to content
Health
85/100
good
  • Security25/25
    No findings
  • Activity20/25
    Last human commit 7 months ago
  • Required by15/25
    1 module depends on it
  • Maturity25/25
    In 11 Odoo series since 8.0

Heuristic over the facts below, not an audit · How it's computed

Security findings
Grave / minor (static analysis)
Required by
1
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.37 MB
Module directory on disk
Code analysis 0 migration notes 2 models 2 views 2 HTTP endpoints

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.

Dependencies

Odoo dependencies
odoo/odoo:
- web
Python dependencies
None
System dependencies
None
Required by
l10n_es_facturae

Code analysis

Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.

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…

Loading…