AttributeError: 'etree._ElementTree' object has no attribute

Re: AttributeError: 'etree._ElementTree' object has no attribute

Postby sraps » Mon Feb 08, 2010 5:43 pm

inaki wrote:According to REQUIRES.txt file, report-openoffice requires two packages: 1) relatorio 2)openoffice-python

The second one is not included in the openerp allinone installer for ubuntu. Procedure:

8.04 : sudo easy_install openoffice-python
9.10 : sudo apt-get install -y python-openoffice

BTW, I’ve figured out how to install python lxml 2.2.4 on Ubuntu 8.04:

sudo apt-get install -y libxml2-dev libxslt1-dev
sudo easy_install “lxml>2.0″

I will take a look where to "accomodate" this info. Thank you, this will be very helpful to others.

On the other hand, openoffice has to be running in headless mode to generate pdf documents (check it out by "ps uaxww | grep -i soffice"). The allinone installer provides a startup script "sudo /etc/init.d/openoffice stop/start"


Headless is not a requirement. For example, you can run OOo ordinary, just open ports, doing this way you will see document popping up, when doing conversion. :)

Of course you would like to have it headless on real production server.
sraps
 
Posts: 403
Joined: Mon May 04, 2009 10:04 pm

Re: AttributeError: 'etree._ElementTree' object has no attribute

Postby joolsr » Mon Feb 08, 2010 6:24 pm

Hi

Thanks for your help. Even after checking I had python-openoffice and lxml > 2.0 installed I still get the same issue ie

<type 'exceptions.KeyError'>: u'odt'
args = (u'odt',)
message = u'odt'

Any further ideas?
joolsr
 
Posts: 7
Joined: Tue Feb 02, 2010 4:07 pm

Re: AttributeError: 'etree._ElementTree' object has no attribute

Postby inaki » Mon Feb 08, 2010 6:52 pm

And about the "odt" error: Is the openerp code up to date? Take a look at the following bug already fixed:

https://bugs.launchpad.net/openobject-c ... bug/498180
Last edited by inaki on Tue Feb 09, 2010 10:02 pm, edited 1 time in total.
inaki
 
Posts: 7
Joined: Mon Feb 08, 2010 4:28 pm

Re: AttributeError: 'etree._ElementTree' object has no attribute

Postby joolsr » Mon Feb 08, 2010 7:20 pm

It's not to do with a missing ODT action, as the line that was missing from actions.py is already present in my install.

Wish I did know what it was though ;-)

Julian
joolsr
 
Posts: 7
Joined: Tue Feb 02, 2010 4:07 pm

Re: AttributeError: 'etree._ElementTree' object has no attribute

Postby inaki » Tue Feb 09, 2010 7:28 pm

The allinone installer is now up to date with the missing libraries that report-openoffice asks for.
Nevertheless, I still get errors when testing report_openoffice_samples:

Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 682, 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/report/report_sxw.py", line 426, in create_source_pdf
return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/report_openoffice/report_openoffice.py", line 247, in create_single_pdf
processed_rml = self.preprocess_rml(etree.XML(rml),report_xml.report_type)
File "lxml.etree.pyx", line 2421, in lxml.etree.XML (src/lxml/lxml.etree.c:23802)
File "parser.pxi", line 1507, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:63888)
ValueError: can only parse strings
inaki
 
Posts: 7
Joined: Mon Feb 08, 2010 4:28 pm

Re: AttributeError: 'etree._ElementTree' object has no attribute

Postby inaki » Tue Feb 09, 2010 8:52 pm

Last error already reported at launchpad (sample reports are outdated):
https://bugs.launchpad.net/report-openo ... bug/515434
inaki
 
Posts: 7
Joined: Mon Feb 08, 2010 4:28 pm

Re: AttributeError: 'etree._ElementTree' object has no attribute

Postby inaki » Tue Feb 09, 2010 9:43 pm

Error obtained on Ubuntu 9.10 following the "How to create your first report" tutorial:

Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 681, in go
obj = netsvc.LocalService('report.'+object)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 66, in __init__
self._service = SERVICES[name]
KeyError: u'report.partner.sample.report'

Same test and result on Ubuntu 8.04:

Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 681, in go
obj = netsvc.LocalService('report.'+object)
File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 66, in __init__
self._service = SERVICES[name]
KeyError: u'report.partner.sample.report'
inaki
 
Posts: 7
Joined: Mon Feb 08, 2010 4:28 pm

Re: AttributeError: 'etree._ElementTree' object has no attribute

Postby sraps » Wed Feb 10, 2010 12:43 pm

inaki wrote:Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 681, in go
obj = netsvc.LocalService('report.'+object)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 66, in __init__
self._service = SERVICES[name]
KeyError: u'report.partner.sample.report'


This is because for some unknown reason report have not been registered as system service. Please try to provide a bit more info, what have you done just before this has happened...
sraps
 
Posts: 403
Joined: Mon May 04, 2009 10:04 pm

Re: AttributeError: 'etree._ElementTree' object has no attribute

Postby inaki » Wed Feb 10, 2010 1:32 pm

I followed your tutorial, then click on Partners -> Partners -> click on one row (Axelor) -> click on "My Sample Report" on the right column.

Dunno how to provide more useful info..
inaki
 
Posts: 7
Joined: Mon Feb 08, 2010 4:28 pm

Re: AttributeError: 'etree._ElementTree' object has no attribute

Postby hcouplet » Tue Mar 02, 2010 6:48 pm

Error obtained on Ubuntu 9.10 following the "How to create your first report" tutorial:

Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 681, in go
obj = netsvc.LocalService('report.'+object)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 66, in __init__
self._service = SERVICES[name]
KeyError: u'report.partner.sample.report'

Same test and result on Ubuntu 8.04:

Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 681, in go
obj = netsvc.LocalService('report.'+object)
File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 66, in __init__
self._service = SERVICES[name]
KeyError: u'report.partner.sample.report'


Got the same error on debian lenny with openErp 5.0.6.
To solve this, change the report type from "pdf" to "OpenOffice - pdf output".
Regards,
Hervé
hcouplet
 
Posts: 8
Joined: Tue Mar 02, 2010 6:45 pm

PreviousNext

Return to Aeroo Reports & OpenOffice.org Reporting Engine

cron
Copyright © 2001 Alistek Ltd., ALL RIGHTS RESERVED