[10.0][MIG] report_xml migration - #143
Conversation
|
Module migrated to 10.0 |
Almost any XML must start with this. Let's make it easier.
Any report inheriting this AbstractModel can check its XML results against any XSD.
dbfb8ce to
81f729d
Compare
| @api.model | ||
| def render_report(self, res_ids, name, data): | ||
| """Special handling for ``qweb-xml`` reports.""" | ||
| if data.get("report_type") == u"qweb-xml": |
There was a problem hiding this comment.
This is sentence is error-prone. I would suggest to search for the report in the first, place, like in https://github.com/OCA/reporting-engine/blob/10.0/report_py3o/models/ir_actions_report_xml.py#L100
, based on the name, or self._cr.execute("SELECT * FROM ir_act_report_xml WHERE report_name=%s", (name,))
And once it has been found, and the type is 'qweb-xml', you can continue with the next steps.
You would even not need to use _loookup_report at all, in case that the type is 'qweb-xml'.
| report_name = 'report_xml.demo_report_xml_view' | ||
| docs = self.env['res.company'].search([], limit=1) | ||
| rep = report_object.render_report( | ||
| docs.ids, report_name, {'report_type': u"qweb-xml"} |
There was a problem hiding this comment.
I can see that the usual practice is to call render_report not specifying the report_type, as it is looked up inside the method.
|
@mreficent can you review? |
MiquelRForgeFlow
left a comment
There was a problem hiding this comment.
LGTM 👍
but just minor comments
| @@ -0,0 +1,102 @@ | |||
| .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | |||
| :alt: License: AGPL-3 | |||
There was a problem hiding this comment.
add :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
| .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
| :alt: License: AGPL-3 | ||
|
|
||
| Qweb XML Reports |
There was a problem hiding this comment.
put ================ on top of the title
the proper name of the module is Report XML
| Configuration | ||
| ============= | ||
|
|
||
| No manual configuration is needed. |
There was a problem hiding this comment.
remove this configuration section
| Known issues / Roadmap | ||
| ====================== | ||
|
|
||
| None |
There was a problem hiding this comment.
remove issues section as there are none
| "name": "Qweb XML Reports", | ||
| "version": "10.0.1.0.0", | ||
| "category": "Reporting", | ||
| "website": "https://odoo-community.org", |
There was a problem hiding this comment.
https://github.com/OCA/reporting-engine
| report_type="qweb-xml" | ||
| model="res.company"/> | ||
|
|
||
|
|
There was a problem hiding this comment.
remove a blank line
|
|
||
| from . import report_action | ||
| from . import report_generator | ||
| # from . import xsd_checked_report |
There was a problem hiding this comment.
remove this comment because no file is provided
| @@ -0,0 +1,48 @@ | |||
| # -*- coding: utf-8 -*- | |||
| # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> | |||
|
|
|||
| @@ -0,0 +1,24 @@ | |||
| # -*- coding: utf-8 -*- | |||
| # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> | |||
|
|
|||
| @@ -0,0 +1,11 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <openerp> | |||
| <data> | |||
There was a problem hiding this comment.
remove data tags and change openerp by odoo
|
Fixes applied |
|
cc: @rgarnau |
Migration of report_xml module.