-
Notifications
You must be signed in to change notification settings - Fork 68
[FIX] util/records: deduplicate before batch update #243
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
Conversation
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
upgradeci retry with always only base hr_recruitment sale_subscription helpdesk |
9ba343d
to
0c74f32
Compare
We perform some DELETEs in `replace_record_references_batch` as a cleanup step. Thus it is better to ensure the mapping always change the id. Example: https://github.com/odoo/upgrade-util/blob/dced6e030db111fab9446b323434e4c2e16bdd62/src/util/records.py#L1723
Modifying the underlying list of indirect references is useful for making flows based on indirect references easier to test. Is is also useful for the upgrade of custom modules after a major upgrade.
20afd15
to
87c87b9
Compare
KangOl
reviewed
Apr 10, 2025
87c87b9
to
9d8928f
Compare
KangOl
reviewed
Apr 10, 2025
cfadb29
to
50d688d
Compare
KangOl
reviewed
Apr 10, 2025
50d688d
to
d1775ac
Compare
`replace_record_references_batch` tries to ensure there are no duplicates when replacing records. It fails when the duplicate is being introduced as a result of two ids mapping to the same target id _and_ no original conflicting record exists.
d1775ac
to
e2dea0e
Compare
KangOl
approved these changes
Apr 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robodoo rebase-ff r+
Merge method set to rebase and fast-forward. |
robodoo
pushed a commit
that referenced
this pull request
Apr 11, 2025
We perform some DELETEs in `replace_record_references_batch` as a cleanup step. Thus it is better to ensure the mapping always change the id. Example: https://github.com/odoo/upgrade-util/blob/dced6e030db111fab9446b323434e4c2e16bdd62/src/util/records.py#L1723 Part-of: #243 Signed-off-by: Christophe Simonis (chs) <[email protected]>
robodoo
pushed a commit
that referenced
this pull request
Apr 11, 2025
Modifying the underlying list of indirect references is useful for making flows based on indirect references easier to test. Is is also useful for the upgrade of custom modules after a major upgrade. Part-of: #243 Signed-off-by: Christophe Simonis (chs) <[email protected]>
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.
When updating record references we need to dedup uniq indexes. In the case of inderect references the case when two old references become the same new reference was missing.
Example to trigger the issue
In such case the record replacer will replace references to the partner bank as in the mapping
{2:1, 3:1}
. But this causes an error