[10.0][OU-FIX] #2339, purge obsolete models and fields - #2536
Merged
pedrobaeza merged 1 commit intoApr 8, 2021
Conversation
StefanRijnhart
force-pushed
the
fix/10.0/noupdate_set_false_where_null
branch
5 times, most recently
from
February 10, 2021 21:15
75ea20a to
3e6a9be
Compare
StefanRijnhart
force-pushed
the
fix/10.0/noupdate_set_false_where_null
branch
2 times, most recently
from
February 16, 2021 15:11
b68ed90 to
038281d
Compare
StefanRijnhart
force-pushed
the
fix/10.0/noupdate_set_false_where_null
branch
3 times, most recently
from
February 18, 2021 11:01
b065d1e to
ee4166f
Compare
Fixes OCA#2339 * add loaded models and fields to the set of loaded XMLIDs * purge models and fields with noupdate NULL instead of FALSE Also * remove coverage as it is giving out red marks to PRs for no reason * check reference count before deleting a record after module upgrade * improve logging when deletion fails (should be rare now) * reduce logging of deletions in CI * remove ir.model.relation from ir.model's unlink This PR is part of a set of PRs for OpenUpgrade 9.0 up to 13.0. Background: While Odoo deletes obsolete field and model entries from the data model metadata explicitely in their migration scripts, in OpenUpgrade I have always meant to rely on the mechanism of purging 'untouched' XMLIDs that takes care of the deletion of obsolete data records (e.g. views). However, this mechanism was not applied to field and model entries because their XMLIDs were created with noupdate NULL instead of FALSE and as such excluded in the query to gather all obsolete data records. Also missing was marking the XMLIDs of fields and models as loaded in the first place. All of this is working properly in Odoo 13 (introduced gradually across new releases) so all of this is backported from newer versions one way or another.
StefanRijnhart
force-pushed
the
fix/10.0/noupdate_set_false_where_null
branch
from
February 26, 2021 13:48
ee4166f to
be7ea95
Compare
StefanRijnhart
marked this pull request as ready for review
February 26, 2021 13:58
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.
Fixes #2339
Also
This PR is part of a set of PRs for OpenUpgrade 9.0 up to 13.0. Background:
While Odoo deletes obsolete field and model entries from the data model
metadata explicitely in their migration scripts, in OpenUpgrade I have
always meant to rely on the mechanism of purging 'untouched' XMLIDs that
takes care of the deletion of obsolete data records (e.g. views).
However, this mechanism was not applied to field and model entries because
their XMLIDs were created with noupdate NULL instead of FALSE and as such
excluded in the query to gather all obsolete data records.
Also missing was marking the XMLIDs of fields and models as loaded in the
first place.
All of this is working properly in Odoo 13 (introduced gradually across new
releases) so all of this is backported from newer versions one way or
another.