Skip to content

[10.0][OU-FIX] #2339, purge obsolete models and fields - #2536

Merged
pedrobaeza merged 1 commit into
OCA:10.0from
VanMoof:fix/10.0/noupdate_set_false_where_null
Apr 8, 2021
Merged

[10.0][OU-FIX] #2339, purge obsolete models and fields#2536
pedrobaeza merged 1 commit into
OCA:10.0from
VanMoof:fix/10.0/noupdate_set_false_where_null

Conversation

@StefanRijnhart

@StefanRijnhart StefanRijnhart commented Feb 7, 2021

Copy link
Copy Markdown
Member

Fixes #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 StefanRijnhart added this to the 10.0 milestone Feb 7, 2021
@StefanRijnhart StefanRijnhart changed the title [TST] Also delete obsolete records with noupdate set to NULL [10.0][TST] Also delete obsolete records with noupdate set to NULL Feb 7, 2021
@StefanRijnhart
StefanRijnhart force-pushed the fix/10.0/noupdate_set_false_where_null branch 5 times, most recently from 75ea20a to 3e6a9be Compare February 10, 2021 21:15
@StefanRijnhart
StefanRijnhart force-pushed the fix/10.0/noupdate_set_false_where_null branch 2 times, most recently from b68ed90 to 038281d Compare February 16, 2021 15:11
@StefanRijnhart StefanRijnhart changed the title [10.0][TST] Also delete obsolete records with noupdate set to NULL [10.0][FIX] Remove obsolete ir.model.fields and ir.model entries Feb 16, 2021
@StefanRijnhart
StefanRijnhart force-pushed the fix/10.0/noupdate_set_false_where_null branch 3 times, most recently from b065d1e to ee4166f Compare February 18, 2021 11:01
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
StefanRijnhart force-pushed the fix/10.0/noupdate_set_false_where_null branch from ee4166f to be7ea95 Compare February 26, 2021 13:48
@StefanRijnhart StefanRijnhart changed the title [10.0][FIX] Remove obsolete ir.model.fields and ir.model entries [10.0][OU-FIX] #2339, purge obsolete models and fields Feb 26, 2021
@StefanRijnhart
StefanRijnhart marked this pull request as ready for review February 26, 2021 13:58
@pedrobaeza
pedrobaeza merged commit d3490c8 into OCA:10.0 Apr 8, 2021
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