Skip to content
Snippets Groups Projects
Commit 11f75dd6 authored by Miquel Raïch's avatar Miquel Raïch
Browse files

[FIX] base: deleting selection fields of non tabled models


When a model selection record is going to be deleted, a _process_ondelete method is called in order to delete all the records of the corresponding model that have that selection. These records are obtained by calling _get_records, which uses a query that needs a table. Thus, we should avoid cases for non-abstract models that have _auto = False.

closes odoo/odoo#133082

X-original-commit: 408175a7
Signed-off-by: default avatarRaphael Collet <rco@odoo.com>
parent f1871890
No related branches found
No related tags found
No related merge requests found
......@@ -1486,7 +1486,7 @@ class IrModelSelection(models.Model):
# the orphaned 'ir.model.fields' down the stack, and will log a
# warning prompting the developer to write a migration script.
field = Model._fields.get(selection.field_id.name)
if not field or not field.store or Model._abstract:
if not field or not field.store or not Model._auto:
continue
ondelete = (field.ondelete or {}).get(selection.value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment