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
[13.0] Removing of model with selection field failed #44767
Comments
I don't think it's a bug, more of a limitation of the ORM and frankly I don't know if we want to support this use-case. Deleting a model is considered an "unstable change" i.e. should not be done in production because the mechanism that cleans up models is done during module uninstallation, the problem in your case is that there's a leftover reflection model ( The uninstall process takes care of all of these steps odoo/odoo/addons/base/models/ir_model.py Lines 1813 to 1926 in a798e23
If you want to do it for development purposes, it may be best to first uninstall the module and then reinstall it or to start with a fresh database |
Sorry don't want to necro-thread ;) But I got here from the 4th result in Google trying to find a solution to this in 14.0. The problem here occurs on a production database because I'm removing an obsolete model so uninstalling the module or restarting a database is out of question ;) So to fix this you have to do proceed in two phases: Phase 1
from odoo import models
class TestModel(models.Model):
_name = "test.model"
_description = "Test Model"
Phase 2:
Hope this helps someone :) |
Impacted versions:
13.0
Steps to reproduce:
selection
fieldCurrent behavior:
Raise an exception for selection option removing.
selection_field_traceback.txt
Expected behavior:
Remove model with all fields and selection options with out exceptions.
Video/Screenshot link (optional):
The text was updated successfully, but these errors were encountered: