Cannot upload a report template that uses a functional field

Bug #965744 reported by jamie campbell
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Confirmed
Low
OpenERP's Framework R&D

Bug Description

While designing a custom report I noticed that I'm no longer able to create new reports. On the Open Office side everything looks fine (the "live update" preview shows what I expect it to show) but when attempting to send I get

2012-03-26 21:28:57,208 12901 WARNING ? openerp.osv.expression: The domain term '('name', '=', ['basic report'])' should use the 'in' or 'not in' operator.
2012-03-26 21:28:57,209 12901 INFO ? werkzeug: 127.0.0.1 - - [26/Mar/2012 21:28:57] "POST /xmlrpc/object HTTP/1.1" 200 -
2012-03-26 21:28:57,226 12901 INFO ? werkzeug: 127.0.0.1 - - [26/Mar/2012 21:28:57] "POST /xmlrpc/object HTTP/1.1" 200 -
2012-03-26 21:28:57,236 12901 WARNING ? openerp.osv.orm: No such field(s) in model ir.values: object.
2012-03-26 21:28:57,238 12901 INFO ? werkzeug: 127.0.0.1 - - [26/Mar/2012 21:28:57] "POST /xmlrpc/object HTTP/1.1" 200 -
2012-03-26 21:28:57,325 12901 ERROR ? openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/pymodules/python2.7/openerp/addons/base_report_designer/base_report_designer.py", line 56, in upload_report
    'report_rml_content': str(sxw2rml(sxwval, xsl=fp.read())),
  File "/usr/lib/pymodules/python2.7/openerp/addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py", line 318, in sxw2rml
    root = etree.XPathEvaluator(result)("/document/stylesheet")
  File "xpath.pxi", line 406, in lxml.etree.XPathEvaluator (src/lxml/lxml.etree.c:114664)
  File "xpath.pxi", line 345, in lxml.etree.XPathDocumentEvaluator.__init__ (src/lxml/lxml.etree.c:114128)
  File "xpath.pxi", line 267, in lxml.etree.XPathElementEvaluator.__init__ (src/lxml/lxml.etree.c:113282)
TypeError: Argument 'element' has incorrect type (expected lxml.etree._Element, got NoneType)

I've attached a very simple sandbox addon that can be used to reproduce this.

Steps to reproduce:

1) create a database
2) add the reportBugDemonstrationAddon addon
3) This will install the base report designer but you may need to install the module in your local copy of Open Office or Libreoffice if you haven't done so
4) in OO (or LO) a) connect to the new database; b) choose "open a new report"; c) pick "A sample entity" for module inclusion; d) add a loop on "list of a sample entity"; e) a couple of lines down, add text "tester field: " then insert the tester field field
5) send to server with name "basic report"
e) error gets generated.

Note that if you do step 1 through 4, but then do export to rml instead of send to server, the exact same problem happens

Revision history for this message
jamie campbell (3-jamie) wrote :
Revision history for this message
jamie campbell (3-jamie) wrote :

oops.. when I originally started posting this I thought it only happened when a functional field was involved and I discovered it was happening for everything. Apparently I forgot to modify "short description" so it's misleading now.

Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello jamie campbell ,

I have checked this issue with your module and follow your given steps
But I did not face any problems regarding this issue.
So would you please provide more information
regarding this issue.

Thanks and waiting for reply!

Changed in openobject-server:
status: New → Incomplete
Revision history for this message
jamie campbell (3-jamie) wrote :

I did further debugging: I archived the information for the xml and xsl and created a little sandbox program that tries to process the information using the same steps as within OpenERP. I've attached a tar with all three...

More info :

a) I'm running Ubuntu 11.10 on a 64 bit PC

b) I'm using LibreOffice 3.4.4. The page at http://doc.openerp.com/v6.0/technical_guide/base_report_designer.html doesn't indicate whether LibreOffice is acceptable and if it is what versions are ok.. but then again, it also doesn't mention which versions of OpenOffice it works with. I should note that as far as I can tell Ubuntu no longer has aptitude management for Open Office so LibreOffice support is pretty important... If necessary, I can probably do a manual install of Open Office but with it being no longer package manager accessible, it's a kludgy short term solution at best.

c) I'm using python 2.7. I didn't do anything to manually mess with lxml or etree so the versions of that being used would be whatever python 2.7 bundles with. There are so files for etree and objectivy in the modules directory and I'm not sure how to query them for what version they are.

Revision history for this message
jamie campbell (3-jamie) wrote :

Regarding point b above : it appears to NOT be a LibreOffice thing. I jumped through some hoops and installed Open Office from manually downloaded deb. It turns out it installs to opt and doesn't conflict with the transitional packages. It appears to not be having any problems (so far) running concurrently with LibreOffice.

The Open Office version from todays download and install is 3.3.0. I installed the report designer extension, did the same "very basic" report : same exact error.

@Jignesh : What version of Open Office are you testing with? I can try to find and install the exact version you're using and see whether or not, with that version, it's a problem on my system (I have a hunch it won't be, but we'll see)

Revision history for this message
jamie campbell (3-jamie) wrote :

I can also try regressing my python if you're testing with an earlier version... although, if it's a python 2.7 issue or a "latest Open Office" issue it'll need to be solved anyway....

Revision history for this message
Khaled Blah (khaled-blah) wrote :

I can confirm what Jamie has reported, I've done similar steps and reached the same conclusion as Jamie.

Revision history for this message
Khaled Blah (khaled-blah) wrote :

I'd like to add that I, too, have installed OpenERP on a Ubuntu 11.10 machine with a 64 bit CPU with python version 2.7.2. Additionally I have also installed it on a Ubuntu 10.10 machine (32-bit) with python version 2.6.6.

Also, like, Jamie, I have tried it using Libreoffice 3.5 and OpenOffice 3.3.

Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :
Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello jamie campbell,

Its producible with OpenOffice3.3 , Its working fine with openoffice3.2.
So problem is version specific.

Thank you.

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Low
status: Incomplete → Confirmed
Revision history for this message
Khaled Blah (khaled-blah) wrote :

Thank you for your confirmation, Jignesh.

Are you going to fix this bug? I can't imagine that we're the only ones who are affected.

Revision history for this message
jamie campbell (3-jamie) wrote :

I should note that the Open Office website itself recommends not using archived builds (which is how it currently classifies 3.2) due to potential security issues, so people will currently only be able to use the integrated reporting features by regressing their version against the official program maintainer's advice.

The actual archive mirrors go all the way back to 1.0.2, so 3.2 will be downloadable and installable for the forseeable future, but it would be unfortunate for OpenERP to be stuck at "Open Office 3.2 or earlier", unless your investigations have confirmed that this is specific to 3.3 (a regression bug) and thus will be fixed in 3.4, rather than the more likely reason of 3.3 having an architectural change that will be carried forward in future versions.

Revision history for this message
jamie campbell (3-jamie) wrote :

Hmm.. I just tried regressing my Open Office to 3.2. It turns out that the extension zip generated by 6.1.1 doesn't work with Open Office 3.2's extension manager. It gets "This media-type is not supported: application/vnd.sun.star.legacy-package-bundle0".

This means:

a) 6.1.1 integrated reporting won't work with Open Office 3.3 because reports designed cannot be uploaded to the server
b) 6.1.1 integrated reporting can't be installed to work with Open Office 3.2 because the zip generated by 6.1.1 won't install

This means that for users who have not already installed OpenERP, to get integrated reporting working, the user needs to:

a) uninstall OpenERP 6.1.1
b) install OpenERP 6.0.3
c) generate the extension zip for Open Office from there
d) install the exension into Open Office 3.2
e) uninstall OpenERP 6.0.3
f) install or reinstall OpenERP 6.1.1

This seems like a sufficiently painful process that I'm really hoping this bug gets reprioritized higher than "low".

Revision history for this message
jamie campbell (3-jamie) wrote :

We have clients who do due diligence, installing OpenERP and trying it out in advance of engaging us.. I can't, with a straight face, tell them to install one version of OpenERP, get a zip file from it, then install another version.. so for now I'm going to have to recommend to clients to try out reporting using a reporting module other than the certified/standard one (which has the bug shown above). Something like http://apps.openerp.com/addon/6987?filter=%7B%22order_by%22%3A+%22click_counter+desc%22%7D&page=9 . I'll have to investigate further to see which non-certified module fits best.

Can we please have a timetable on when this, in my opinion quite serious, bug will be addressed?

Revision history for this message
Jason Loughead (13l0yp6v-jason-k4cybxwf) wrote :

This is affecting us too.

Revision history for this message
Khaled Blah (khaled-blah) wrote :

Hi Jamie, hi Jason,

we have found the "report_webkit" to be a viable - albeit not perfect - alternative to the standard report facility. First there is this bug but the webkit alternative is also more flexible and allows for more fine grained styling than RML does. However, this bug still is a show stopper IMO.

Revision history for this message
jamie campbell (3-jamie) wrote :

Checking in on activity with this bug : is it still the position of the OpenERP team that the bug is low priority because the reporting subsystem works with Open Office 3.2? Since reporting the bug, Open Office is now at version 3.4.1 with version 4 scheduled for release in the first half of 2013. Currently the suggestion (above) is that people should keep their version of Open Office two minor version points behind the latest version. When 4 is released the suggestion will be that people should keep their version of Open Office a full major version point behind the times.

Would OpenERP consider switching from the current "standard" reporting module to report_webkit, which works fine and has continued to work fine from this bug first being reported until now?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.