Odoo Help

Welcome!

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.

0

Odoo V8: IndexError reconciliation on bank statement

By
Christian Rentsch
on 4/4/15, 9:17 AM 808 views

Hello All,

I have received the following IndexError at the reconciliation on bank statements.

#########################################

Odoo Server Error

Traceback (most recent call last):

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

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

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

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

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

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

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

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

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

return self.endpoint(*a, **kw)

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

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

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

response = f(*args, **kw)

File "/opt/odoo/odoo8/addons/web/controllers/main.py", line 935, in call_kw

return self._call_kw(model, method, args, kwargs)

File "/opt/odoo/odoo8/addons/web/controllers/main.py", line 927, in _call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)

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

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

File "/opt/odoo/odoo8/addons/account/account_bank_statement.py", line 470, in get_data_for_reconciliations

reconciliation_proposition = self.get_reconciliation_proposition(cr, uid, st_line, excluded_ids=excluded_ids, context=context)

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

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

File "/opt/odoo/odoo8/addons/account/account_bank_statement.py", line 574, in get_reconciliation_proposition

match_id = self.get_move_lines_for_reconciliation(cr, uid, st_line, excluded_ids=excluded_ids, offset=0, limit=1, additional_domain=domain_exact_amount)

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

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

File "/opt/odoo/odoo8/addons/account/account_bank_statement.py", line 683, in get_move_lines_for_reconciliation

mv_lines = mv_line_pool.prepare_move_lines_for_reconciliation_widget(cr, uid, lines, target_currency=target_currency, target_date=st_line.date, context=context)

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

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

File "/opt/odoo/odoo8/addons/account/account_move_line.py", line 834, in prepare_move_lines_for_reconciliation_widget

amount_str = rml_parser.formatLang(actual_debit or actual_credit, currency_obj=target_currency)

File "/usr/lib/python2.7/dist-packages/openerp/report/report_sxw.py", line 218, in formatLang

self._get_lang_dict()

File "/usr/lib/python2.7/dist-packages/openerp/report/report_sxw.py", line 172, in _get_lang_dict

lang_obj = pool_lang.browse(self.cr,self.uid,lang_ids[0])

IndexError: list index out of range

2

Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--
4136
| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
On 4/4/15, 9:32 AM

Hi,

set a lang to your partner related company (partner associated to your company in company view form), error due to :

in openerp/report/report_sxw.py :


class rml_parse(object):

     def __init__(self, cr, uid, name, parents=rml_parents, tag=rml_tag, context=None):

         .......

         self.localcontext = { ...............

            'lang' : user.company_id.partner_id.lang,

            ........}


     def _get_lang_dict(self):

         pool_lang = self.pool.get('res.lang')

         lang = self.localcontext.get('lang', 'en_US') or 'en_US'

         lang_ids = pool_lang.search(self.cr,self.uid,[('code','=',lang)])

         if not lang_ids:

               lang_ids = pool_lang.search(self.cr,self.uid,[('code','=','en_US')])

         lang_obj = pool_lang.browse(self.cr,self.uid,lang_ids[0])

Bye

0
Christian Rentsch
On 4/4/15, 9:57 AM

Thank you, that was the mistake.

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)

Stats

Asked: 4/4/15, 9:17 AM
Seen: 808 times
Last updated: 4/4/15, 9:57 AM