“Error: list index out of rangeparagraph text u’’caused exception”

[Solved] : “Error: list index out of rangeparagraph text u'<para></font></para>’ caused exception”.

Operating System : Ubuntu 14.04 LTS

Openerp version : 7.0

Postgresql version : 9.3

ReportLab version : 3.04

OpenERP 7.0 has many reporting options available.RML Reporting is one of the key feature to produce documents.Most of the Reports/Documents in OpenERP are developed in RML. RML is a report markup language created by ReportLab Europe Ltd. Key feature of this language is it can be used to generate PDF files. Adobe’s PDF format is universally accepted, and OpenERP also makes use of  this format as the primary method of providing documents to the OpenERP end user.

For one of our client, we had developed an Inventory report as per their requirements.It was functioning properly and generating proper output.At this point of time,we were using Ubuntu 12.04 LTS as a production environment and Reportlab version was 2.6. However we have to do Server Migration to new location and we upgraded production environment to Ubuntu 14.04 LTS  and Reportlab version was also updated to 3.1.

Then when while testing the instance and functionality,we were unable to print that Inventory Report and was coming across one error as following.

Error :

except_osv: (u”list index out of rangeparagraph text u'<para></font></para>’ caused exception”, (<type ‘exceptions.IndexError’>, IndexError(“list index out of rangeparagraph text u'<para></font></para>’ caused exception”,), <traceback object at 0xb21d6a54>))

Solution :

It was difficult to understand the cause of an error as we were hardly able to see the actual cause of an error. We made lot of changes in the RML file for sorting out the error. We tried to figure out the reason over internet and unfortunately there were no solutions available.But it was of no use.After debugging for good amount of time,we came to conclusion that it is the version of reportlab which is causing this issue to pop up. As a result of it, we decided to degrade the reportlab version back to 2.6. and it really worked. We can now print that Inventory report without any issue.This setting worked for me and the pdf was able to print in openerp.

2 responses to ““Error: list index out of rangeparagraph text u’’caused exception””

  1. ezequiel says:

    Hola buenas tardes gracias por compartir la solución, me ha funcionado.

You must be logged in to post a comment.