Skip to content

Issue installing Partner Statement on V16 #1299

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

Closed
PhillipHumint opened this issue Mar 18, 2025 · 2 comments
Closed

Issue installing Partner Statement on V16 #1299

PhillipHumint opened this issue Mar 18, 2025 · 2 comments
Labels

Comments

@PhillipHumint
Copy link

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.

@gdgellatly
Copy link

gdgellatly commented Mar 19, 2025

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.

@PhillipHumint
Copy link
Author

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

2 participants