Skip to content
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

Closed
wants to merge 11 commits into from
Closed

Add module report_xml. #14

wants to merge 11 commits into from

Conversation

yajo
Copy link
Member

@yajo yajo commented Jun 10, 2015

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.

.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3

Module name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put module name here

@pedrobaeza
Copy link
Member

Can you provide a report_xml_sample module as an example for this?

@yajo
Copy link
Member Author

yajo commented Jun 10, 2015

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...

@pedrobaeza
Copy link
Member

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.

@mylbco
Copy link

mylbco commented Jun 10, 2015

@pedrobaeza yes, I can agree on that

Jairo Llopis added 5 commits June 11, 2015 12:57
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.
@yajo
Copy link
Member Author

yajo commented Jun 12, 2015

Creating a dummy module does not seem very pleasing to me. This module is going to be extensively used in the upcoming l10n_es_training module, so I took that one as the sample module and referenced it in the README.

BTW I also added a couple of missing pieces to this module: a base template and a base XSD report checker.

@pedrobaeza
Copy link
Member

Then it's going to be very difficult to review this PR unless we have any sample

@yajo
Copy link
Member Author

yajo commented Jun 29, 2015

Is the sample OK?

@pedrobaeza
Copy link
Member

Thanks for the sample! Maybe I miss an option to select the fields of the XML, but as a first version is very appreciated.

👍

@yajo
Copy link
Member Author

yajo commented Jul 3, 2015

What do you mean?

@pedrobaeza
Copy link
Member

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?

@yajo
Copy link
Member Author

yajo commented Jul 3, 2015

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).

@pedrobaeza
Copy link
Member

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.

@yajo
Copy link
Member Author

yajo commented Jul 3, 2015

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. 😉

@yajo
Copy link
Member Author

yajo commented Jul 3, 2015

Please don't merge this still, I've got another PR coming that I consider more important.

@yajo
Copy link
Member Author

yajo commented Jul 3, 2015

Closing this until #18 gets fixed.

@yajo yajo closed this Jul 3, 2015
@yajo yajo mentioned this pull request Jul 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants