account-reconcile icon indicating copy to clipboard operation
account-reconcile copied to clipboard

[16.0] account_reconcile_oca: error when open transactions menu in runboat DB

Open rinaldifirdaus opened this issue 1 year ago • 3 comments

Module

account_reconcile_oca

Describe the bug

In the following runboat database, error occurs when opening transactions menu from invoicing dashboard. http://oca-account-reconcile-16-0-28d467153ecb.runboat.odoo-community.org/web#action=274&model=account.journal&view_type=kanban&cids=1&menu_id=121

error message:

Traceback (most recent call last):
  File "/opt/odoo/odoo/api.py", line 984, in get
    cache_value = field_cache[record._ids[0]]
KeyError: 8

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/fields.py", line 1160, in __get__
    value = env.cache.get(record, self)
  File "/opt/odoo/odoo/api.py", line 991, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'account.bank.statement.line(8,).can_reconcile'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/api.py", line 984, in get
    cache_value = field_cache[record._ids[0]]
KeyError: 8

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/fields.py", line 1160, in __get__
    value = env.cache.get(record, self)
  File "/opt/odoo/odoo/api.py", line 991, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'account.bank.statement.line(8,).reconcile_data_info'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/opt/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/opt/odoo/odoo/http.py", line 1611, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/opt/odoo/odoo/http.py", line 1815, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/opt/odoo/odoo/http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/opt/odoo/addons/web/controllers/dataset.py", line 42, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/odoo/api.py", line 461, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo/odoo/api.py", line 448, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/odoo/models.py", line 2985, in read
    return self._read_format(fnames=fields, load=load)
  File "/opt/odoo/odoo/models.py", line 3164, in _read_format
    vals[name] = convert(record[name], record, use_name_get)
  File "/opt/odoo/odoo/models.py", line 5897, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/opt/odoo/odoo/fields.py", line 1209, in __get__
    self.compute_value(recs)
  File "/opt/odoo/odoo/fields.py", line 1387, in compute_value
    records._compute_field_value(self)
  File "/opt/odoo/odoo/models.py", line 4221, in _compute_field_value
    fields.determine(field.compute, self)
  File "/opt/odoo/odoo/fields.py", line 100, in determine
    return needle(records, *args)
  File "/opt/odoo/addons/base_sparse_field/models/fields.py", line 52, in _compute_sparse
    values = record[self.sparse]
  File "/opt/odoo/odoo/models.py", line 5897, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/opt/odoo/odoo/fields.py", line 1209, in __get__
    self.compute_value(recs)
  File "/opt/odoo/odoo/fields.py", line 1387, in compute_value
    records._compute_field_value(self)
  File "/opt/odoo/odoo/models.py", line 4221, in _compute_field_value
    fields.determine(field.compute, self)
  File "/opt/odoo/odoo/fields.py", line 97, in determine
    return needle(*args)
  File "/mnt/data/odoo-addons-dir/account_reconcile_oca/models/account_bank_statement_line.py", line 333, in _compute_reconcile_data_info
    record.reconcile_data_info = record._default_reconcile_data(
  File "/mnt/data/odoo-addons-dir/account_reconcile_oca/models/account_bank_statement_line.py", line 444, in _default_reconcile_data
    *self._reconcile_data_by_model(
  File "/mnt/data/odoo-addons-dir/account_reconcile_oca/models/account_bank_statement_line.py", line 362, in _reconcile_data_by_model
    for line in reconcile_model._get_write_off_move_lines_dict(
  File "/opt/odoo/addons/account/models/account_reconcile_model.py", line 523, in _get_write_off_move_lines_dict
    if currency.is_zero(balance):
UnboundLocalError: local variable 'balance' referenced before assignment

The above server error caused the following client error:
null

To Reproduce

Affected versions: 16.0

Steps to reproduce the behavior:

  1. go to invoicing>on dashboard open 3 dots on Bank journal Kanban view>transactions 2023-09-20_08h25_52

Expected behavior

Additional context

@qrtl

rinaldifirdaus avatar Sep 20 '23 01:09 rinaldifirdaus

This seems to be an old issue https://github.com/OCA/account-reconcile/pull/500#issuecomment-1484668648 that was fixed but after https://github.com/OCA/account-reconcile/pull/580 the issue is back again.

astirpe avatar Sep 26 '23 12:09 astirpe

Hi, This issue has been reported to Odoo and it seems they are going to apply a FIX: https://github.com/odoo/odoo/issues/116064#issuecomment-1951988865

ACheung-FactorLibre avatar Feb 19 '24 09:02 ACheung-FactorLibre

solution????

aksharabiju avatar Apr 03 '24 09:04 aksharabiju

It should be already solved.

pedrobaeza avatar Sep 20 '24 20:09 pedrobaeza