We've got the port of our OpenERP module jasper_reports running on Tryton
already but we want integration to be better and we found some issues I'd like
to discuss:
* Translations *
The first one has been in ir.translation. We inherit the wizard that extracts
the strings from reports but in order to reuse some code we did a small
refactoring in core 'ir' module. We will post a code review for that.
* Engine *
We miss an 'engine' field in ir.action.report for both translations and also to
make jasper_reports first class citizens. In order to use jasper reports we
must declar the action in the XML but *also* we must add a class:
from jasper import JasperReport
class SampleReport(JasperReport):
_name = 'jasper_reports.sample'
SampleReport()
I think we could add an 'engine' field of type Selection to ir.action.report
that allowed default Report class decide which engine it should execute.
That'd mean:
- By default (in trytond) engine field only has one entry: 'relatorio'.
- Report class is made much more simple and just checks which engine it must
use and calls the engine 'execute' function.
- We create a RelatorioReport class that contains current Report
functionality.
- There's still the issue of what is the smartest way to register new report
engines to the system so that Report can make the appropriate call.
* Actions *
We find ir.action.report is too tight to relatorio. Fields like
'template_extension', 'style' or the long list of extensions are a good
example of that.
I'm not very sure how we should improve that, the simplest option is to add
the 'engine' field mentioned above in trytond, add all the fields we need in
the
jasper_reports module and when the engine is 'jasper' simply hide all
unnecessary fields.
Comments?
--
Albert Cervera i Areny
http://www.NaN-tic.com
Tel: +34 93 553 18 03
http://twitter.com/albertnan
http://www.nan-tic.com/blog
--
[email protected] mailing list