hello
El dia 12/03/2017 23.25, "Peter Müller" <[email protected]> va
escriure:
Got tryton 4.2 and jasper_reports module installed. I define a report like
this
<record model="ir.action.report" id="pac_label">
<field name="name">Labels</field>
<field name="model">mod.pac</field>
<field name="report_name">pac.label</field>
<field name="report">mod/reports/label.jrxml</field>
<field name="extension">pdf</field>
</record>
And got this error when calling the report:
Traceback (most recent call last):
File "/trytond/wsgi.py", line 47, in dispatch_request
return endpoint(request, **request.view_args)
File "/trytond/protocols/dispatcher.py", line 41, in rpc
request, database_name, *request.rpc_params)
File "/trytond/wsgi.py", line 39, in auth_required
return wrapped(*args, **kwargs)
File "/trytond/protocols/wrappers.py", line 107, in wrapper
return func(request, pool, *args, **kwargs)
File "/trytond/protocols/dispatcher.py", line 160, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File "/trytond/report/report.py", line 153, in execute
if not isinstance(content, unicode):
File "/trytond/report/report.py", line 238, in render
if hasattr(data, 'getvalue'):
File "/relatorio/reporting.py", line 121, in __call__
template = self.tmpl_loader.load(self.fpath, self.mimetype)
File "/relatorio/reporting.py", line 81, in load
path, cls=cls, relative_to=relative_to)
File "/genshi/template/loader.py", line 236, in load
filename, encoding=encoding)
File "/genshi/template/loader.py", line 274, in _instantiate
allow_exec=self.allow_exec)
File "/relatorio/templates/opendocument.py", line 248, in __init__
encoding, lookup, allow_exec)
File "/genshi/template/markup.py", line 67, in __init__
allow_exec=allow_exec)
File "/genshi/template/base.py", line 419, in __init__
self._stream = self._parse(source, encoding)
File "/relatorio/templates/opendocument.py", line 269, in _parse
zf = zipfile.ZipFile(source)
File "/zipfile.py", line 770, in __init__
self._RealGetContents()
File "/zipfile.py", line 811, in _RealGetContents
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file
I understand that is called still the ODT report engine and the JRXML isn't
a zip file.
I supose that the jasper_report module isn't registred as a report engine
and/or JasperReports
.action.report is'nt correct.
You need to create a python class from JasperReports
See examples at trytond-*_jreports modules
Regards
--
You received this message because you are subscribed to the Google Groups
"tryton" group.
To view this discussion on the web visit https://groups.google.com/d/
msgid/tryton/0a40d004-1281-4f6d-a5f0-61b1d0229d1e%40googlegroups.com
<https://groups.google.com/d/msgid/tryton/0a40d004-1281-4f6d-a5f0-61b1d0229d1e%40googlegroups.com?utm_medium=email&utm_source=footer>
.
--
You received this message because you are subscribed to the Google Groups
"tryton" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tryton/CAN2HbXXN%2Bh7SU6isBVo_%3D9YE2zp9eFVJ-%3DBAz%3DzOJqf8GqSPaw%40mail.gmail.com.