diff --git a/README.md b/README.md index a37dcc9149..09c12682da 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ addon | version | maintainers | summary [report_wkhtmltopdf_param](report_wkhtmltopdf_param/) | 17.0.1.0.0 | | Add new parameters for a paper format to be used by wkhtmltopdf command as arguments. [report_xlsx](report_xlsx/) | 17.0.1.0.2 | | Base module to create xlsx report [report_xlsx_helper](report_xlsx_helper/) | 17.0.1.0.1 | | Report xlsx helpers -[report_xml](report_xml/) | 17.0.1.0.0 | | Allow to generate XML reports +[report_xml](report_xml/) | 17.0.1.0.1 | | Allow to generate XML reports [sql_export](sql_export/) | 17.0.1.0.1 | legalsylvain | Export data in csv file with SQL requests [sql_export_excel](sql_export_excel/) | 17.0.1.0.0 | | Allow to export a sql query to an excel file. [sql_export_mail](sql_export_mail/) | 17.0.1.0.0 | legalsylvain | Send csv file generated by sql query by mail. diff --git a/report_xml/README.rst b/report_xml/README.rst index add8db2f8c..fe0f99adc6 100644 --- a/report_xml/README.rst +++ b/report_xml/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + =========== XML Reports =========== @@ -7,13 +11,13 @@ XML Reports !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:f5a881c0eade552010cfe051f392fb1c7a5d474081f114d52a1f2a21d851096f + !! source digest: sha256:36059ef46a8482f0fe4bfca50064c81a9bbff28da52d1a35614557640940054c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status :alt: Production/Stable -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github @@ -42,9 +46,9 @@ Installation To install this module, you need to: -- Install `lxml `__ in Odoo's ``$PYTHONPATH``. -- Install the repository - `reporting-engine `__. +- Install `lxml `__ in Odoo's ``$PYTHONPATH``. +- Install the repository + `reporting-engine `__. But this module does nothing for the end user by itself, so if you have it installed it's probably because there is another module that depends @@ -66,12 +70,12 @@ companies views. To develop with this module, you need to: -- Create a module. -- Make it depend on this one. -- Follow `instructions to create - reports `__ - having in mind that the ``report_type`` field in your - ``ir.actions.report`` record must be ``qweb-xml``. +- Create a module. +- Make it depend on this one. +- Follow `instructions to create + reports `__ + having in mind that the ``report_type`` field in your + ``ir.actions.report`` record must be ``qweb-xml``. In case you want to create a `custom report `__, @@ -96,8 +100,8 @@ your XML report online as a web page. For further information, please visit: -- https://www.odoo.com/forum/help-1 -- https://github.com/OCA/reporting-engine +- https://www.odoo.com/forum/help-1 +- https://github.com/OCA/reporting-engine Bug Tracker =========== @@ -121,22 +125,22 @@ Authors Contributors ------------ -- Enric Tobella +- Enric Tobella -- `Tecnativa `__: +- `Tecnativa `__: - - Jairo Llopis + - Jairo Llopis -- `Avoin.Systems `__: +- `Avoin.Systems `__: - - Tatiana Deribina + - Tatiana Deribina -- Iván Antón +- Iván Antón Other credits ------------- -- Icon taken from http://commons.wikimedia.org/wiki/File:Text-xml.svg +- Icon taken from http://commons.wikimedia.org/wiki/File:Text-xml.svg Maintainers ----------- diff --git a/report_xml/__init__.py b/report_xml/__init__.py index 64ad933661..853dc17d55 100644 --- a/report_xml/__init__.py +++ b/report_xml/__init__.py @@ -3,4 +3,3 @@ from . import controllers from . import models from . import reports -from .hooks import post_init_hook diff --git a/report_xml/__manifest__.py b/report_xml/__manifest__.py index e287279e64..9e2b5d5e6b 100644 --- a/report_xml/__manifest__.py +++ b/report_xml/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). { "name": "XML Reports", - "version": "17.0.1.0.0", + "version": "17.0.1.0.1", "category": "Reporting", "website": "https://github.com/OCA/reporting-engine", "development_status": "Production/Stable", @@ -29,5 +29,4 @@ "lxml" # XML and HTML with Python ] }, - "post_init_hook": "post_init_hook", } diff --git a/report_xml/demo/report.xml b/report_xml/demo/report.xml index f0744bf487..3ad224b4b2 100644 --- a/report_xml/demo/report.xml +++ b/report_xml/demo/report.xml @@ -8,11 +8,6 @@ res_company report - diff --git a/report_xml/hooks.py b/report_xml/hooks.py deleted file mode 100644 index 932bfdbf27..0000000000 --- a/report_xml/hooks.py +++ /dev/null @@ -1,41 +0,0 @@ -# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). - -import os - - -def post_init_hook(env): - """ - Loaded after installing this module, and before the next module starts - installing. - - Add XSD Validation Schema for a demo report if it's in the system. - Demo data records are always created with `noupdate == True` and render of - tag `report` doesn't support new `ir.actions.report` field `xsd_schema`. - Thus it is impossible to define `xsd_schema` in the demo definition or add - schema after that via xml update record. Therefore it possible to add value - to `xsd_schema` field for demo record only via hook. - - Args: - * env(odoo.api.Environment) - provides access to the models - """ - report_domain = [ - ("report_name", "=", "report_xml.demo_report_xml_view") # report tech name - ] - demo_report = env["ir.actions.report"].search(report_domain, limit=1) - if demo_report: - dir_path = os.path.dirname(__file__) - xsd_file_relative_path = "demo/demo_report.xsd" - xsd_file_full_path = os.path.join(dir_path, xsd_file_relative_path) - - with open(xsd_file_full_path) as xsd: - # `xsd_schema` is binary fields with an attribute - # `attachment=True` so XSD Schema will be added as attachment - attach_vals = { - "name": "Demo Report.xsd", - "datas": xsd.read(), - "res_model": "ir.actions.report", - "res_id": demo_report.id, - "res_field": "xsd_schema", - "type": "binary", - } - env["ir.attachment"].create(attach_vals) diff --git a/report_xml/static/description/index.html b/report_xml/static/description/index.html index d56db643e3..2abfe0bf5e 100644 --- a/report_xml/static/description/index.html +++ b/report_xml/static/description/index.html @@ -3,15 +3,16 @@ -XML Reports +README.rst -
-

XML Reports

+
+ + +Odoo Community Association + +
+

XML Reports

-

Production/Stable License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

+

Production/Stable License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

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.

@@ -391,7 +397,7 @@

XML Reports

-

Installation

+

Installation

To install this module, you need to:

  • Install lxml in Odoo’s $PYTHONPATH.
  • @@ -403,11 +409,11 @@

    Installation

    on it.

-

Usage

+

Usage

This module is intended as a base engine for other modules to use it, so no direct result if you are a user.

-

If you are a developer

+

If you are a developer

To learn from an example, just check the demo report on GitHub for the model res.company or check it in interface from @@ -446,7 +452,7 @@

If you are a developer

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -454,16 +460,16 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Tecnativa
  • Avoin.Systems
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

@@ -495,5 +503,6 @@

Maintainers

+
diff --git a/report_xml/tests/test_report_xml.py b/report_xml/tests/test_report_xml.py index b378991968..b89ac6cef3 100644 --- a/report_xml/tests/test_report_xml.py +++ b/report_xml/tests/test_report_xml.py @@ -10,6 +10,10 @@ class TestXmlReport(common.HttpCase): + def test_demo_loaded(self): + report = self.env.ref("report_xml.demo_xml_report") + self.assertTrue(report.xsd_schema) + def test_xml(self): report_object = self.env["ir.actions.report"] report_name = "report_xml.demo_report_xml_view"