Skip to content

ValueError: invalid literal for int() with base 10: 'false' in _compute_analytic_account_ids #1322

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

Open
gcaceres93 opened this issue May 23, 2025 · 0 comments
Labels

Comments

@gcaceres93
Copy link

Title:
ValueError: invalid literal for int() with base 10: 'false' in _compute_analytic_account_ids

Module
account_financial_report

Describe the bug
When installing the account_financial_report module on Odoo 15, an error is raised due to invalid string parsing in the _compute_analytic_account_ids method.

The issue occurs at this line:

python
Copiar
Editar
for account_id in map(int, key.split(",")):
When key contains the string 'false', it triggers a ValueError because 'false' cannot be converted to an integer.

To Reproduce
Affected versions:

Odoo 17.0

Steps to reproduce:

Try to install the account_financial_report module from the OCA repository.

Wait for the server to load and process the module.

Observe the traceback error.

Full traceback:

csharp
Copiar
Editar
ValueError: invalid literal for int() with base 10: 'false'
Expected behavior
The installation should succeed without errors. The method _compute_analytic_account_ids should handle invalid values gracefully and not assume all values can be cast to integers.

Additional context

Running on Odoo SaaS (no access to modify backend code)

Python 3.10+

PostgreSQL 13

Server: https://zubapy.odoo.com/

Suggested fix:

python
Copiar
Editar
try:
account_ids = list(map(int, key.split(',')))
except (ValueError, AttributeError):
account_ids = []

@gcaceres93 gcaceres93 added the bug label May 23, 2025
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