OCA / openupgradelib

A library with support functions to be called from Odoo migration scripts.
GNU Affero General Public License v3.0
85 stars 171 forks source link

[ADD] clean_transient_models #363

Closed MiquelRForgeFlow closed 5 months ago

MiquelRForgeFlow commented 5 months ago

clean_transient_models

Clean transient models to prevent possible issues due to chained data.

To be run at the base post-migration script for having a general scope.Only works on > v8.

Used in https://github.com/OCA/OpenUpgrade/pull/4374.

StefanRijnhart commented 5 months ago

Because model._transient_clean_rows_older_than uses a browse on the target model, is it not the case that, when called in the base module's migration script, this fails for any model not defined in the base module of the upgrade target version? As such, would it not be much more useful to implement the cleaning using SQL?