Hello, I have installed the module “tryton-jasper_reports” and “trytond-account_jasper_reports” and they work correctly. I have created a new report of the party.party model and I have the following error when executing it, any clue as to why?
Traceback (most recent call last):
File "/usr/local/lib/python39/dist-packages/trytond/wsgipy", line 117, in dispatch_request
return endpoint(request, **requestview_args)
File "/usr/local/lib/python39/dist-packages/trytond/protocols/dispatcherpy", line 47, in rpc
return methodsget(requestrpc_method, _dispatch)(
File "/usr/local/lib/python39/dist-packages/trytond/wsgipy", line 84, in auth_required
return wrapped(*args, **kwargs)
File "/usr/local/lib/python39/dist-packages/trytond/protocols/wrapperspy", line 159, in wrapper
return func(request, pool, *args, **kwargs)
File "/usr/local/lib/python39/dist-packages/trytond/protocols/dispatcherpy", line 181, in _dispatch
result = rpcresult(meth(*c_args, **c_kwargs))
File "/usr/local/lib/python39/dist-packages/trytond/report/reportpy", line 219, in execute
oext, content = cls_execute(
File "/usr/local/lib/python39/dist-packages/trytond/report/reportpy", line 236, in _execute
return clsconvert(action, clsrender(action, report_context))
File "/usr/local/lib/python39/dist-packages/trytond/report/reportpy", line 327, in render
mimetype = MIMETYPES[reporttemplate_extension]
KeyError: 'jrxml'
IIRC the jasper reports module requires that you register a report in the pool to enable that jasper conversion. This is legacy code as with register_mixin is now possible to override the behaviour of all reports in the pool.
Why are you using account_jasper_reports? IIRC All the reports included there are available in the standard tryton modules.
register_mixin is the way to avoid such requirement. But the module has not been updated to use the new features included on tryton. This is one of the reasons that I will not recomend using external modules but collobarate on improving the standard ones.
As Sergi said if jasper_reports used register_mixin it would not be necessary to declare a class for each report.
You can see how it is used in the html_report, which is newer and does use this feature:
If you want to propose a patch for jasper_reports that uses register_mixin it would probably be accepted.
We’re not implementing it because we’re moving away from jasper_reports, although it will be available and maintained in newer versions for quite some time.