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.

2

Unable to Unreconcile customer payment because of a KeyError

By
Janno Liivak
on 7/10/14, 3:40 PM 2,334 views

When I try to Unreconcile customer payment I get a following error:

>>>
2014-07-10 19:27:55,381 11652 ERROR mycompany openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
  File "/Users/janno_liivak/development/python/odoo/openerp/http.py", line 476, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/Users/janno_liivak/development/python/odoo/openerp/http.py", line 495, in dispatch
    result = self._call_function(**self.params)
  File "/Users/janno_liivak/development/python/odoo/openerp/http.py", line 311, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/Users/janno_liivak/development/python/odoo/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/Users/janno_liivak/development/python/odoo/openerp/http.py", line 308, in checked_call
    return self.endpoint(*a, **kw)
  File "/Users/janno_liivak/development/python/odoo/openerp/http.py", line 685, in __call__
    return self.method(*args, **kw)
  File "/Users/janno_liivak/development/python/odoo/openerp/http.py", line 360, in response_wrap
    response = f(*args, **kw)
  File "/Users/janno_liivak/development/python/odoo/addons/web/controllers/main.py", line 987, in call_button
    action = self._call_kw(model, method, args, {})
  File "/Users/janno_liivak/development/python/odoo/addons/web/controllers/main.py", line 975, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/Users/janno_liivak/development/python/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/Users/janno_liivak/development/python/odoo/addons/account_voucher/account_voucher.py", line 952, in cancel_voucher
    reconcile_pool.unlink(cr, uid, [line.reconcile_id.id])
  File "/Users/janno_liivak/development/python/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/Users/janno_liivak/development/python/odoo/addons/account/account.py", line 1617, in unlink
    return super(account_move_reconcile, self).unlink(cr, uid, ids, context=context)
  File "/Users/janno_liivak/development/python/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/Users/janno_liivak/development/python/odoo/openerp/models.py", line 3533, in unlink
    recs.recompute()
  File "/Users/janno_liivak/development/python/odoo/openerp/api.py", line 202, in wrapper
    return new_api(self, *args, **kwargs)
  File "/Users/janno_liivak/development/python/odoo/openerp/models.py", line 5449, in recompute
    f.name: rec[f.name] for f in field.computed_fields
  File "/Users/janno_liivak/development/python/odoo/openerp/models.py", line 5449, in <dictcomp>
    f.name: rec[f.name] for f in field.computed_fields
  File "/Users/janno_liivak/development/python/odoo/openerp/models.py", line 5330, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/Users/janno_liivak/development/python/odoo/openerp/fields.py", line 679, in __get__
    return record._cache[self]
  File "/Users/janno_liivak/development/python/odoo/openerp/models.py", line 5643, in __getitem__
    value = self._recs.env.cache[field][self._recs.id]
KeyError: 19
>>>

There's an old payment which invoice was credited (or reversed or Refunded ... whatever the term). New invoice was issued and old payment was like an advance payment an it was reconciled together with additional payment for the new (a little bigger amount of money). All was well and good but the date of a new payment was incorrect ... so now I will have to unreconcile the new payment and correct the date.

How to overcome the error? What causes it anyway?

It seems to be a cache error in the server. Have you tried to restart the server?

Ivan
on 11/20/14, 2:00 AM

Yes, I tried that. And it's definitly not connected to server cache ... well, not directly anyway.

Janno Liivak
on 11/20/14, 3:19 AM
0
Yakito
On 11/19/14, 7:23 AM

Hey, I don't know if this is remotely close to solve your problem, I will tell you what I did to solve mine after installing v8 and getting also a KeyError. I simpley reverted the translation to english (I had it in portuguese) and it works now for me. I am not sure why and now I am looking on how to get it back into portuguese without an error,  but there was something in that translaton that broke the Json. Hope it helps somehow.

Yes, that's it. I already figured this one out from some other forum post.

Janno Liivak
on 11/20/14, 3:04 AM

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

3 follower(s)

Stats

Asked: 7/10/14, 3:40 PM
Seen: 2334 times
Last updated: 3/16/15, 8:10 AM