← Back to team overview

openerp-community team mailing list archive

Re: New module for spreadsheets creation through Python code interpreted from the UI

 

Hello Community,

I have created a generic reporting module called "spreadsheet_creator" that
enables (among other things) to create spreadsheet (.csv, .xls file)
according to Python code that will be interpreted from the User Interface.
Usually, to create such reports, I was using "base_report_creator" that
interprets sql queries from the UI but I was struggling to read the
functional fields not stored in database so I thought that it could be good
to have something that interprets python code besides of sql queries. Also,
the "base_report_creator" module proposed "only" 2 parameters: "date from"
and "date to". With this new module, you have the choice to set whatever
parameters you want (group by date, list of products...) and use them with
a classic orm read method in your code fields.

The thing is that it is not only limited to reports creation. As you can
execute *any* python code, you can do whatever you want, and it can be
dangerous... So I have tried to secure it with consistent user rights, so
that only the relevant people (i.e. the admin) can configure them.

I have followed as much as possible the Guidelines stated here:
https://doc.openerp.com/contribute/05_developing_modules/

I have seen that a project has been created for reporting engines:
https://launchpad.net/openerp-reporting-engines so I was thinking to push
it there (please tell me if it is not the right place).

*It is hosted here at the moment*:
https://github.com/matthiouz/openerp-addons/tree/master/report_spreadsheet

If you want to test it.
- there is no dependency, so you can install it on a bare DB (without other
modules than the core ones)
- it is accessible from the menu "Settings| Reporting| Reports Generation"
that you can access as admin without user rights configuration. But for
other users you will have to configure that: 1st in there access rights tab
(to access the menu), 2nd on the report (to access the report, because each
report has its own user access)
- there is one simple example (that is inactive by default)

I am very interested in your feedback, ideas...

Yours,

Matt Choplin
OpenERP developer at made.com
https://twitter.com/Matthiouz