You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Module
partner_statement (part of account-financial-reporting)
Describe the Bug
When attempting to install the partner_statement module, the installation fails with a KeyError: 'active_ids'. The error occurs when the module tries to access "active_ids" from the context, but it is missing.
To Reproduce
Affected versions: Odoo 16.0
Steps to reproduce the behavior:
Navigate to Apps in Odoo.
Search for and install the partner_statement module.
The installation process fails with a traceback error.
Expected Behavior
The module should install successfully without errors.
Error Log
python
Copy
Edit
2025-03-13 05:47:33,241 2828189 ERROR realvisionv16.humint.co.za odoo.http: Exception during request handling.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 2071, in call
response = request._serve_db()
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1658, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 152, in retrying
result = func()
...
File "/var/odoo/realvisionv16.humint.co.za/extra-addons/account-financial-reporting.git-67d2714bceeeb/partner_statement/wizard/statement_common.py", line 24, in
default=lambda self: len(self._context["active_ids"])
KeyError: 'active_ids'
Additional Context
OS: Ubuntu 22.04
Python Version: 3.x
The issue appears to be caused by the default field trying to access "active_ids" in the context without checking if it exists.
Suggested Fix
Modify the line in statement_common.py:
default=lambda self: len(self._context.get("active_ids", []))
This will prevent the error when "active_ids" is not available in the context.
The text was updated successfully, but these errors were encountered:
Well make a PR, it is good practice but I am less than convinced it is the root cause.
I feel like some upstream bugfix has had unintended consequences. There is just no reason for that default to be evaluated at install and I got it on another previously harmless default idiom this week. default=lambda s: s.env.ref('somexmlrecordofmodule') which has worked forever and a day, and now it fails.
Module
partner_statement (part of account-financial-reporting)
Describe the Bug
When attempting to install the partner_statement module, the installation fails with a KeyError: 'active_ids'. The error occurs when the module tries to access "active_ids" from the context, but it is missing.
To Reproduce
Affected versions: Odoo 16.0
Steps to reproduce the behavior:
Navigate to Apps in Odoo.
Search for and install the partner_statement module.
The installation process fails with a traceback error.
Expected Behavior
The module should install successfully without errors.
Error Log
python
Copy
Edit
2025-03-13 05:47:33,241 2828189 ERROR realvisionv16.humint.co.za odoo.http: Exception during request handling.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 2071, in call
response = request._serve_db()
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1658, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 152, in retrying
result = func()
...
File "/var/odoo/realvisionv16.humint.co.za/extra-addons/account-financial-reporting.git-67d2714bceeeb/partner_statement/wizard/statement_common.py", line 24, in
default=lambda self: len(self._context["active_ids"])
KeyError: 'active_ids'
Additional Context
OS: Ubuntu 22.04
Python Version: 3.x
The issue appears to be caused by the default field trying to access "active_ids" in the context without checking if it exists.
Suggested Fix
Modify the line in statement_common.py:
default=lambda self: len(self._context.get("active_ids", []))
This will prevent the error when "active_ids" is not available in the context.
The text was updated successfully, but these errors were encountered: