[19.0][ADD] crm_lead_company_currency_fix: new module#722
Open
SilvioC2C wants to merge 2 commits into
Open
Conversation
92d306f to
4910c2a
Compare
4910c2a to
c9683fb
Compare
ivantodorovich
approved these changes
Jan 19, 2026
yankinmax
approved these changes
Feb 2, 2026
yankinmax
left a comment
There was a problem hiding this comment.
Thanks for the deep analysis.
This probably needs to be backported to older versions.
Contributor
|
This PR has the |
1 similar comment
Contributor
|
This PR has the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Odoo standard source code, leads' currency is defined as a computed, non-stored field, which follows this workflow:
Since the field is not stored, it leads to 2 main issues:
Changing a company's currency will change the currency on all the existing leads linked to that company, but not the amounts. Eg:
If a lead is not linked to a specific company, then 2 users that are logged in with 2 different companies and different currencies will see the lead's amounts with different currencies. Eg:
This module stores the field in the DB to keep data consistency, and will only update the lead's currency only if the lead's company itself is updated. The behavior for computing the lead's currency will remain the same (currency is retrieved from the lead's company or the current user's company), but the issues are fixed:
Changing a company's currency will not change the currency on existing leads, only on the ones created after the currency has been updated. Eg:
If a lead is not linked to a specific company, then 2 users that are logged in with 2 different companies and different currencies will see the lead's amounts with the same currency (computed from the company of the first user that triggers the recomputation). Eg: