Skip to content

[18][FIX] account_asset_management : Avoid recomputation loop in invoice line if an account is linked to multiple profiles#2232

Open
florian-dacosta wants to merge 1 commit intoOCA:18.0from
akretion:18-fix-account-asset-management-multiple-account-profile
Open

[18][FIX] account_asset_management : Avoid recomputation loop in invoice line if an account is linked to multiple profiles#2232
florian-dacosta wants to merge 1 commit intoOCA:18.0from
akretion:18-fix-account-asset-management-multiple-account-profile

Conversation

@florian-dacosta
Copy link
Copy Markdown
Contributor

To reproduce the bug :
Create 2 asset profiles for a same asset account (example : "profile 2 years" and "profile 5 years")
Set one of these 2 profile as a default profile on the account, example "profile 2 years".

Then create a supplier invoice and choose the asset account. Odoo set the asset profile "profile 2 years" by default.
Now, try to change the asset profile for the other one "profile 5 years" : you can't.
This is because changing the profile triggers the _onchange_asset_profile_id method, which set the asset account on the line. And setting the asset account triggers the recompute of the profile with _compute_asset_profile, which reset the default profile.

@bguillot @pedrobaeza Would you mind to review this "easy" one ?

…line if an account is linked to multiple profiles
@pedrobaeza pedrobaeza added this to the 18.0 milestone Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants