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

account_loan: cannot process loans after upgrade from Odoo 12 to 16 #1817

Open
aissaghouti opened this issue Feb 13, 2024 · 0 comments
Open
Labels

Comments

@aissaghouti
Copy link

Module

account_loan

Describe the bug

We upgraded Odoo from version 12 to 16, since then we get an error message when we want to process some loans, but not all.

To Reproduce

Affected versions: 16

Steps to reproduce the behavior:

  1. We have defined loans and they are in the process position. See screenshot 1.
    Screenshot 1
  2. We click on the process button to activate the loan for that given month.
  3. When clicked, we should get a "Values" on the button, as in screenshot 2.
    Screenshot 2
  4. In stead of this "values" button, I have the error shown in screenshot 3.
    screenshot 3

Expected behavior:
We should get "Values" button.

Additional context:
Odoo 16.0+e (Enterprise Edition)

Error logs:

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "/home/odoo/src/odoo/odoo/api.py", line 996, in get
cache_value = field_cache[record._ids[0]]
KeyError: 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/odoo/src/odoo/odoo/fields.py", line 1161, in get
value = env.cache.get(record, self)
File "/home/odoo/src/odoo/odoo/api.py", line 1003, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'account.loan(2,).fixed_amount'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/odoo/src/odoo/odoo/http.py", line 1591, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/home/odoo/src/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/home/odoo/src/odoo/odoo/http.py", line 1618, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/home/odoo/src/odoo/odoo/http.py", line 1822, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "/home/odoo/src/odoo/odoo/http.py", line 697, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/home/odoo/src/odoo/addons/web/controllers/dataset.py", line 46, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/home/odoo/src/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/odoo/src/odoo/odoo/api.py", line 468, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/home/odoo/src/odoo/odoo/api.py", line 453, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/home/odoo/src/user/account_loan/models/account_loan_line.py", line 446, in view_process_values
self._generate_move()
File "/home/odoo/src/user/account_loan/models/account_loan_line.py", line 369, in _generate_move
move.action_post()
File "/home/odoo/src/enterprise/l10n_be_reports_post_wizard/models/account_move.py", line 36, in action_post
return super().action_post()
File "/home/odoo/src/odoo/addons/sale/models/account_move.py", line 63, in action_post
res = super(AccountMove, self).action_post()
File "/home/odoo/src/user/account_loan/models/account_move.py", line 29, in action_post
record.loan_line_id.loan_id._compute_posted_lines()
File "/home/odoo/src/user/account_loan/models/account_loan.py", line 385, in _compute_posted_lines
line._check_amount()
File "/home/odoo/src/user/account_loan/models/account_loan_line.py", line 220, in _check_amount
self.payment_amount = self._compute_amount()
File "/home/odoo/src/user/account_loan/models/account_loan_line.py", line 175, in _compute_amount
return self.loan_id.fixed_amount
File "/home/odoo/src/odoo/odoo/fields.py", line 1210, in get
self.compute_value(recs)
File "/home/odoo/src/odoo/odoo/fields.py", line 1392, in compute_value
records._compute_field_value(self)
File "/home/odoo/src/odoo/addons/mail/models/mail_thread.py", line 403, in _compute_field_value
return super()._compute_field_value(field)
File "/home/odoo/src/odoo/odoo/models.py", line 4232, in _compute_field_value
fields.determine(field.compute, self)
File "/home/odoo/src/odoo/odoo/fields.py", line 98, in determine
return needle(*args)
File "/home/odoo/src/user/account_loan/models/account_loan.py", line 269, in _compute_fixed_amount
numpy_financial.pmt(
NameError: name 'numpy_financial' is not defined

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
at makeErrorFromResponse (https://savics.odoo.com/web/assets/31388-a37633a/web.assets_backend.min.js:998:163)
at XMLHttpRequest. (https://savics.odoo.com/web/assets/31388-a37633a/web.assets_backend.min.js:1006:13)

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

1 participant