-
-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add module report_xml. #14
Conversation
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:alt: License: AGPL-3 | ||
|
||
Module name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put module name here
Can you provide a report_xml_sample module as an example for this? |
Are you sure you want a sample module? Is it not better to add demo data to this one? After all, reports are data files... |
Well, it can be a solution, but I think people would prefer to test it and study independently from having the option of demo data checked. |
@pedrobaeza yes, I can agree on that |
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.
Creating a dummy module does not seem very pleasing to me. This module is going to be extensively used in the upcoming BTW I also added a couple of missing pieces to this module: a base template and a base XSD report checker. |
Then it's going to be very difficult to review this PR unless we have any sample |
Is the sample OK? |
Thanks for the sample! Maybe I miss an option to select the fields of the XML, but as a first version is very appreciated. 👍 |
What do you mean? |
I don't see in the sample a way to define only some fields of the record to export in the XML, or may I miss something? |
It's a QWeb report in all means. In the sample I only export id and name because it is an example and it should be simple by definition, but you can export any field you want. See a real world sample here to see how versatile it is (it's a WIP). |
Ah, OK, I didn't get the real usage then (that's why I insist then on the sample and/or documentation), and you can see that still the sample maybe it's not enough, but I'm not going to insist more for now on this. |
The READMEs are short, but just follow exactly what they say and you should have your XML report in no time, and the real docs are those of QWeb, that are linked in them. Currently QWeb reports are HTML, which is itself an XML, so the only thing this module does is to make it download it as XML instead of rendering it in the browser. XSD are XML schemas that validate XML documents, very often used to make sure the XML you send is going to be accepted by the other party. There are other validation methods (DTD, RelaxNG...), but I did not include any of them since I don't need them right now and XSD seems to be the most used. The sample is small on purpose and IMHO it's better that way. It includes also an XSD and the method to check it. I encourage you to install it and see how it works and read carefuly the READMEs, you'll see it's very easy. 😉 |
Please don't merge this still, I've got another PR coming that I consider more important. |
Closing this until #18 gets fixed. |
In order to fix OCA/l10n-spain#174 I need to generate XML files, so here is the reporting engine for that.
It allows developers to generate XML reports using QWeb, and print them using the standard Odoo tools. See README for instructions.