jasper repots crash when printing report on centos server

Bug #455220 reported by Normunds (Alistek)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openobject-jasper-reports
New
Undecided
Unassigned

Bug Description

Jasper repots crash when printing report on centos server.
OpenERP-Client Version : 5.0.6
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/openerp-server/service/web_services.py", line 687, in go
    (result, format) = obj.create(cr, uid, ids, datas, context)
  File "/usr/lib/python2.4/site-packages/openerp-server/addons/jasper_reports/jasper_report.py", line 202, in create
    return r.execute()
  File "/usr/lib/python2.4/site-packages/openerp-server/addons/jasper_reports/jasper_report.py", line 90, in execute
    generator.generate( dataFile )
  File "/usr/lib/python2.4/site-packages/openerp-server/addons/jasper_reports/JasperReports/BrowseDataGenerator.py", line 234, in generate
    self.allRecords += self.generateIds( record, relations, '', [ { 'root': record } ] )
  File "/usr/lib/python2.4/site-packages/openerp-server/addons/jasper_reports/JasperReports/BrowseDataGenerator.py", line 80, in generateIds
    unrepeated = set( [field.partition('/')[0] for field in relations] )
AttributeError: 'str' object has no attribute 'partition'

Googling around shows, that it could be related to python version 2.4 (not supported method) what is used in Red Hat Linux and clones.

Revision history for this message
Hugo Santos (Factorlibre) (hugosantosred) wrote :

Hi, I found this problem too in a centos server, as you say is related to python2.4 that haven't that method.

I made a homemade solution that consist in introduce the function partition in all the files that uses it.

The function is:

def partition(self, cad, sep):
    num = cad.find(sep)
    if num:
        c1 = cad[0:num]
        c2 = cad[num:num+1]
        c3 = cad[num+1:len(cad)]
        cadena = [c1, c2, c3]
        return cadena
    else:
        return cad

Then you have to change all the calls to the function from field.partition('/')[0] to self.partition(field,'/')[0]

affects: openobject-client-kde → openobject-jasper-reports
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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