Error
15 posts • Page 1 of 2 • 1, 2
ErrorI am trying to get report_openoffice working with openerp-server stable/5.0 on ubuntu 8.04 LTS.
I'm using rev4 of report_open_office (lp:report-openoffice). If I try and use any of the samples from the report_openoffice_samples module I get the following error: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 703, in go (result, format) = obj.create(cr, uid, ids, datas, context) File "/opt/openerp/stable/5.0/addons/report_openoffice/report_openoffice.py", line 291, in create return fnct(cr, uid, ids, data, report_xml, context) File "/usr/lib/python2.5/site-packages/openerp-server/report/report_sxw.py", line 426, in create_source_pdf return self.create_single_pdf(cr, uid, ids, data, report_xml, context) File "/opt/openerp/stable/5.0/addons/report_openoffice/report_openoffice.py", line 240, in create_single_pdf return self.create_relatorio_report(cr, uid, ids, data, report_xml, context=context, output='pdf') File "/opt/openerp/stable/5.0/addons/report_openoffice/report_openoffice.py", line 105, in create_relatorio_report inzip = zipfile.ZipFile(in_oo, mode='r') File "/usr/lib/python2.5/zipfile.py", line 346, in __init__ self._GetContents() File "/usr/lib/python2.5/zipfile.py", line 366, in _GetContents self._RealGetContents() File "/usr/lib/python2.5/zipfile.py", line 378, in _RealGetContents raise BadZipfile, "File is not a zip file" BadZipfile: File is not a zip file If I try and update any of the report definitions in "Administration|Low Level Objects|Actions|Report XML" I get the following error: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 244, in dispatch result = LocalService(service_name)(method, *params) File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 73, in __call__ return getattr(self, method)(*params) File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 597, in execute res = service.execute(db, uid, object, method, *args) File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 61, in wrapper return f(self, dbname, *args, **kwargs) File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 120, in execute res = pool.execute_cr(cr, uid, obj, method, *args, **kw) File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 112, in execute_cr return getattr(object, method)(cr, uid, *args, **kw) File "/opt/openerp/stable/5.0/addons/report_openoffice/report_xml.py", line 139, in write parser=load_from_source("from report import report_sxw\n"+vals['parser_def']) File "/opt/openerp/stable/5.0/addons/report_openoffice/report_openoffice.py", line 326, in load_from_source exec source in context File "<string>", line 2 class Parser(report_sxw.rml_parse): ^ SyntaxError: invalid syntax Thanks for any help.
Re: ErrorThanks - that's good to hear that it's just he sample reports that need updating.
Re: ErrorChecked on Ubuntu Server 9.10 64bit and OpenERP server 5.0.6
I got the same error : Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 687, in go (result, format) = obj.create(cr, uid, ids, datas, context) File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/report_openoffice/report_openoffice.py", line 290, in create return fnct(cr, uid, ids, data, report_xml, context) File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/report_openoffice/report_openoffice.py", line 179, in create_relatorio_report outzip.writestr(f_info, outzip.read(f_info.filename)) File "/usr/lib/python2.6/zipfile.py", line 831, in read return self.open(name, "r", pwd).read() File "/usr/lib/python2.6/zipfile.py", line 871, in open zinfo.orig_filename, fname) BadZipfile: File name in directory "Configurations2/statusbar/" and header "mimetype" differ. Something wrong with libs , will check next week. P.S. Error is caused by python library: /usr/lib/python2.6/zipfile.py There are lot of changes in that library in Ubuntu. Centos uses an older one (working). If I replace Ubuntus zipfile.py by that older one form Centos then it is working. BUT I do not recommend to do that. We will check out what's wrong and will fix for Ubuntu in next week.
Re: ErrorThere were errors.
Check this patch, will add it in next revision.
Re: ErrorThanks for the patch.
Should the sample reports work now with this patch or will they still need to be updated?
Re: ErrorThe badZipFile error went away but was replaced by another error. It was the one in my above post about the syntax error. There's that string that gets exec-ed """class Parser( ... """ and it kept throwing a syntax error. I was fooling around with it and for whatever reason, if I put a comment after each line it is fixed. I'm sure someone more skilled than I can fix it properly from here.
After *fixing* that error, the badZipFile error is back: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 703, in go (result, format) = obj.create(cr, uid, ids, datas, context) File "/opt/openerp/stable/5.0/addons/report_openoffice/report_openoffice.py", line 292, in create return fnct(cr, uid, ids, data, report_xml, context) File "/opt/openerp/stable/5.0/addons/report_openoffice/report_openoffice.py", line 104, in create_relatorio_report inzip = zipfile.ZipFile(in_oo, mode='r') File "/usr/lib/python2.5/zipfile.py", line 346, in __init__ self._GetContents() File "/usr/lib/python2.5/zipfile.py", line 366, in _GetContents self._RealGetContents() File "/usr/lib/python2.5/zipfile.py", line 378, in _RealGetContents raise BadZipfile, "File is not a zip file" BadZipfile: File is not a zip file
Re: Errorfile_data is always False or None in the OpenOffice_parser.create_relatorio_report() function because "import tools" was missing at the top of report_xml.py.
This was pretty tough to find because it's wrapped in a try and is happy to set the contents to false with no error or log entry. Now there is a new error: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 703, in go (result, format) = obj.create(cr, uid, ids, datas, context) File "/opt/openerp/stable/5.0/addons/report_openoffice/report_openoffice.py", line 313, in create return fnct(cr, uid, ids, data, report_xml, context) File "/usr/lib/python2.5/site-packages/openerp-server/report/report_sxw.py", line 426, in create_source_pdf return self.create_single_pdf(cr, uid, ids, data, report_xml, context) File "/opt/openerp/stable/5.0/addons/report_openoffice/report_openoffice.py", line 251, in create_single_pdf return self.create_relatorio_report(cr, uid, ids, data, report_xml, context=context, output='pdf') File "/opt/openerp/stable/5.0/addons/report_openoffice/report_openoffice.py", line 209, in create_relatorio_report basic = Template(source=None, filepath=odt_path) File "/usr/lib/python2.5/site-packages/relatorio-0.5.3-py2.5.egg/relatorio/templates/opendocument.py", line 196, in __init__ encoding, lookup, allow_exec) File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-x86_64.egg/genshi/template/base.py", line 377, in __init__ self.stream = list(self._prepare(self._parse(source, encoding))) File "/usr/lib/python2.5/site-packages/relatorio-0.5.3-py2.5.egg/relatorio/templates/opendocument.py", line 208, in _parse content = template._parse(self.insert_directives(content), encoding) File "/usr/lib/python2.5/site-packages/relatorio-0.5.3-py2.5.egg/relatorio/templates/opendocument.py", line 263, in insert_directives self._escape_values(tree) File "/usr/lib/python2.5/site-packages/relatorio-0.5.3-py2.5.egg/relatorio/templates/opendocument.py", line 637, in _escape_values for element in tree.iter(): AttributeError: 'etree._ElementTree' object has no attribute 'iter'
Re: ErrorTrying to troubleshoot this, report_openoffice.py hands off the correct path to the tmp odt file here:
basic = Template(source=None, filepath=odt_path) I added a log line and the path handed to relatorio is a valid odt archive that can be unzipped and looks complete. This is the version of relatorio that was installed on my system (ubuntu 8.04 LTS): relatorio-0.5.3-py2.5.egg
Re: ErrorIt looks like the iter method was not introduced in lxml until v2 and on my system it is v 1.3.6.
I have used easy_install lxml=2.0 but that does not seem to replace the v1.3.6 - it installs in parallel but importing lxml still gets you the v1.3.6. I think maybe Ubuntu needs the older version?
15 posts • Page 1 of 2 • 1, 2
|
Copyright © 2001 Alistek Ltd., ALL RIGHTS RESERVED

