Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rinaldifirdaus opened this issue Sep 20, 2023 · 4 comments
Labels

Comments

@rinaldifirdaus
Copy link

rinaldifirdaus commented Sep 20, 2023

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

@astirpe
Copy link
Member

astirpe commented Sep 26, 2023

This seems to be an old issue #500 (comment) that was fixed but after #580 the issue is back again.

@ACheung-FactorLibre
Copy link
Contributor

Hi,
This issue has been reported to Odoo and it seems they are going to apply a FIX: odoo/odoo#116064 (comment)

@aksharabiju
Copy link

solution????

@pedrobaeza
Copy link
Member

It should be already solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants