“Error: list index out of rangeparagraph text u’
[Solved] : “Error: list index out of range paragraph 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 a key feature to produce documents. Most of the Reports/Documents in OpenERP are developed in RML. Similarly, RML is a report markup language created by ReportLab Europe Ltd. This language generates 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 in time, we were using Ubuntu 12.04 LTS as a production environment and Reportlab version was 2.6.
However, we made the following changes :
- Server Migration to a new location.
- Upgraded production environment to Ubuntu 14.04 LTS.
- Also Updated Reportlab version 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.
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>))
It was difficult to understand the cause of an error as we were hardly able to see it. We also made a lot of changes in the RML file for sorting out the error. We tried to figure out the reason over the internet and unfortunately, there were no solutions available. But it was of no use. After debugging for a good amount of time, we came to the 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 also now print that Inventory report without any issue. This setting worked for me and the pdf was able to print in OpenERP.