Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


IndexError: list index out of range from Customer Portal from invoice

on 6/12/16, 7:53 PM 352 views

When a customer clicks on the invoice in their customer portal, I get this:

IndexError: list index out of range

I am using Odoo9 Enterprise.

Full log:

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/openerp/addons/website/models/ir_http.py", line 243, in _handle_exception

response = super(ir_http, self)._handle_exception(exception)

File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_http.py", line 157, in _handle_exception

return request._handle_exception(exception)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 781, in _handle_exception

return super(HttpRequest, self)._handle_exception(exception)

File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_http.py", line 182, in _dispatch

result = request.dispatch()

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 840, in dispatch

r = self._call_function(**self.params)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 316, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper

return f(dbname, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 309, in checked_call

result = self.endpoint(*a, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 959, in __call__

return self.method(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 509, in response_wrap

response = f(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/addons/report/controllers/main.py", line 45, in report_routes

pdf = report_obj.get_pdf(cr, uid, docids, reportname, data=data, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/report/models/report.py", line 157, in get_pdf

html = self.get_html(cr, uid, ids, report_name, data=data, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/report/models/report.py", line 123, in get_html

report = self._get_report_from_name(cr, uid, report_name)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/report/models/report.py", line 476, in _get_report_from_name

idreport = report_obj.search(cr, uid, conditions)[0]

IndexError: list index out of range


Jérémy Kersten (jke)

--Jérémy Kersten (jke)--
| 3 2 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 9/18/16, 11:41 AM

Seems like you have renamed the default report...

Can you reproduce you bug on runbot ? if yes, don't hesitate to open an issue on github !

peter p
On 9/17/16, 4:38 PM

We are having the same issue, is there an answer to this?



| 4 3 5
Hyderabad, India

On 6/13/16, 6:36 AM


the result of search on report_obj is an empty list(there is no report found as per the 'condition') <br/>and from empty list the code is trying to fetch the first record..

you can remove [0] from the end of report_obj.search(cr, uid, conditions)[0] and check the returned value..

Hope it helps!    

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 6/12/16, 7:53 PM
Seen: 352 times
Last updated: 9/18/16, 11:41 AM