-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
[IMP] openupgrade_framework: Do remove the ir.model.fields entries #4499
Comments
What do you think @StefanRijnhart @hbrunn @MiquelRForgeFlow @legalsylvain ? |
I have not a clear point of view on your topic. I have to begin some migrations in the summer. I'll can think about it then. |
isn't this a job for database_cleanup? |
well the job of database_cleanup is to clean database that can have inconsistent things over the time. But it makes senses to conserve column, for safety reasons, and for possible reuses. The question of @pedrobaeza is : does it make sense to keeep ir.model.fields entries ? A the first sight, my answer is "no". But I need to dig deeper into the subject. What do you think ? |
Yes, that's it. Although it's true that |
Where do we exactly override and prevent the removal of the ir.model.fields entries? |
Indeed I can't find such patch, but it's happening. Maybe a side effect? |
What version are we talking about? |
It was 16.0, but let me retest and tell you back, as I may find an incorrect path in my procedure. |
I would expect the ir.model.fields removal to be triggered from ir.model.data's |
On a migration from 15 to 16, installing on the 16 migrated database the module
Creating a 15 database from scratch and migrating with OpenUpgrade, the fields entries are removed, so the process is working well. Digging a bit more, I have found the problem: There's a remaining XML-ID, which prevents it to be removed, coming from Odoo 12, where the nomenclature was changed for having a double underscore separator instead of one for avoiding problems with duplicated XML-IDs from different fields (example: field I will check:
cc @chienandalu |
This serves for cleaning old XML-ID entries: env["ir.model.data"].search([("model", "=", "ir.model.fields")]).filtered(lambda x: "__" not in x.name).unlink() |
@pedrobaeza Good find! |
the condition can go into the domain too, right? |
I tried that with |
Several times reviewing migrated databases, to not remove the
ir.model.fields
entries has confused me a lot for some "missing field" errors. I agree that we should preserved the SQL columns, but I'm feeling lately that preserving also these entries only brings confusion, so I think we should remove the patch to prevent the removal on this one.The text was updated successfully, but these errors were encountered: