Error

Re: Error

Postby emyllymaki » Wed Jan 27, 2010 7:14 am

Uninstalling lxml v1.3.6 and installing lxml 2.1 has got me past the iter() error.

Now I have a PIL 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 315, in create
return fnct(cr, uid, ids, data, report_xml, context)
File "/opt/openerp/stable/5.0/addons/report_openoffice/report_openoffice.py", line 215, in create_relatorio_report
data = basic.generate(**oo_parser.localcontext).render().getvalue()
File "/usr/lib/python2.5/site-packages/relatorio-0.5.3-py2.5.egg/relatorio/templates/base.py", line 36, in render
return self.serializer(self.events)
File "/usr/lib/python2.5/site-packages/relatorio-0.5.3-py2.5.egg/relatorio/templates/opendocument.py", line 708, in __call__
for kind, data, pos in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-x86_64.egg/genshi/template/markup.py", line 245, in _match
for event in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-x86_64.egg/genshi/template/base.py", line 543, in _exec
for event in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-x86_64.egg/genshi/template/base.py", line 496, in _eval
for kind, data, pos in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-x86_64.egg/genshi/template/base.py", line 558, in _flatten
for event in self._flatten(substream, ctxt, **vars):
File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-x86_64.egg/genshi/template/base.py", line 558, in _flatten
for event in self._flatten(substream, ctxt, **vars):
File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-x86_64.egg/genshi/template/base.py", line 551, in _flatten
for event in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-x86_64.egg/genshi/template/directives.py", line 175, in _generate
attrs = _eval_expr(self.expr, ctxt, **vars)
File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-x86_64.egg/genshi/template/base.py", line 286, in _eval_expr
retval = expr.evaluate(ctxt)
File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-x86_64.egg/genshi/template/eval.py", line 180, in evaluate
return eval(self.code, _globals, {'__data__': data})
File "/tmp/openoffice-report-LXsM1T.odt", line 1, in <Expression u"__relatorio_make_dimension(barcode(o.ean13,'ean13',height=96), '4.674cm', '1.796cm')">
PK����š;<^Æ2 '���'������mimetypeapplication/vnd.oasis.opendocument.textPK����š;<���������������Configurations2/statusbar/PK��š;<������������'���Configurations2/accelerator/current.xml�PK�����������PK����š;<���������������Configurations2/floater/PK����š;<���������������Configurations2/popupmenu/PK����š;<���������������Configurations2/progressbar/PK����š;<���������������Configurations2/menubar/PK����š;<���������������Configurations2/toolbar/PK����š;<���������������Configurations2/images/Bitmaps/PK����š;<-Hwˆ��wˆ��-���Pictures/100002010000023F000000DD3849AD72.png‰PNG
File "/opt/openerp/stable/5.0/addons/report_openoffice/barcode/barcode.py", line 38, in make_barcode
im = bar.getImage(code,height)
File "/opt/openerp/stable/5.0/addons/report_openoffice/barcode/EANBarCode.py", line 173, in getImage
font = ImageFont.load("/opt/openerp/stable/5.0/addons/report_openoffice/barcode/courB08.pil")
File "/usr/lib/python2.5/site-packages/PIL-1.1.7-py2.5-linux-x86_64.egg/ImageFont.py", line 193, in load
f._load_pilfont(filename)
File "/usr/lib/python2.5/site-packages/PIL-1.1.7-py2.5-linux-x86_64.egg/ImageFont.py", line 95, in _load_pilfont
return self._load_pilfont_data(file, image)
File "/usr/lib/python2.5/site-packages/PIL-1.1.7-py2.5-linux-x86_64.egg/ImageFont.py", line 117, in _load_pilfont_data
image.load()
File "/usr/lib/python2.5/site-packages/PIL-1.1.7-py2.5-linux-x86_64.egg/ImageFile.py", line 189, in load
d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
File "/usr/lib/python2.5/site-packages/PIL-1.1.7-py2.5-linux-x86_64.egg/Image.py", line 385, in _getdecoder
raise IOError("decoder %s not available" % decoder_name)
IOError: decoder zip not available

Most threads i've seen on this refer to not having zlib support working with PIL but my PIL install summary says:

*** TKINTER support not available (Tcl/Tk 8.5 libraries needed)
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
*** FREETYPE2 support not available

Note, the templates in report_openoffice_samples use the get_barcode() method but in the newer report_openoffice the method name and signature has changed to make_barcode() (called with barcode() in the odt file).
Last edited by emyllymaki on Wed Jan 27, 2010 6:28 pm, edited 1 time in total.
emyllymaki
 
Posts: 17
Joined: Thu Jan 21, 2010 4:04 am

Re: Error

Postby Normunds » Wed Jan 27, 2010 12:19 pm

The good way to check if it's working at all is to:
- Make a new Report XML object for desired object (let's say res.partner), call it Test Print Button
- Save it
- make new odt template with only Simple sentence in it - Let's say "Hello world!". Then upload it in Template Content: field.
- choose report type as OpenOffice-odt
-save
-create Print button with right sided wizard
- open any Partner ad print via button.
It should open odt document with Hello world! sentence.

+ We discovered some more errors in this code section, will fix them and upload in launchpad. At this moment we are testing.
Normunds
 
Posts: 35
Joined: Tue May 12, 2009 10:34 am

Re: Error

Postby emyllymaki » Wed Jan 27, 2010 6:37 pm

Normunds wrote:The good way to check if it's working at all is to:
- Make a new Report XML object for desired object (let's say res.partner), call it Test Print Button
- Save it
- make new odt template with only Simple sentence in it - Let's say "Hello world!". Then upload it in Template Content: field.
- choose report type as OpenOffice-odt
-save
-create Print button with right sided wizard
- open any Partner ad print via button.
It should open odt document with Hello world! sentence.


Simple test reports like you detail above work just fine, both as odt or pdf type.

It is the barcode examples and that strange zip decoder error that are not working. It is the barcode reports that I am specifically looking at using.
emyllymaki
 
Posts: 17
Joined: Thu Jan 21, 2010 4:04 am

Re: Error

Postby ytello » Sun Jan 31, 2010 7:54 am

For next error:

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'

Change the method iter() by getiterator()

Best Regards
ytello
 
Posts: 1
Joined: Sun Jan 31, 2010 7:48 am

Re: Error

Postby emyllymaki » Mon Feb 01, 2010 4:23 am

I figured out the PIL error.

I built it the first time without some of the prerequisites (zlib-ev, jpeg-dev). I satisfied the pre-reqs and rebuilt and the build script said that zlib suport was now available but it was not.

So I removed all traces of PIL, rebuilt again and now it is working.
emyllymaki
 
Posts: 17
Joined: Thu Jan 21, 2010 4:04 am

Previous

Return to Aeroo Reports & OpenOffice.org Reporting Engine

cron
Copyright © 2001 Alistek Ltd., ALL RIGHTS RESERVED