Skip to content
Snippets Groups Projects
Commit 2db0787d authored by Richard Mathot's avatar Richard Mathot Committed by Raphael Collet
Browse files

[FIX] models: ignore dependencies of fields inherited from custom fields


When adding a custom field, the ORM also adds it to all the inherits'ed
models, but with the state `base`, because those inherited fields are
automatic (created by the ORM).  However, dependencies are enforced for
`base` fields, while they can be ignored for `manual` ones.  This is a
problem when a custom field is fucked up: its inherited fields will make
the registry crash.

We fix the issue by not enforcing dependency check on fields inherits'ed
from custom fields.

opw-2191114

closes odoo/odoo#44966

X-original-commit: 05ad62e4
Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
parent 3b29b23e
No related branches found
No related tags found
No related merge requests found
......@@ -255,7 +255,7 @@ class Registry(Mapping):
continue
for field in model._fields.values():
# dependencies of custom fields may not exist; ignore that case
exceptions = (Exception,) if field.manual else ()
exceptions = (Exception,) if field.base_field.manual else ()
with ignore(*exceptions):
dependencies[field] = set(field.resolve_depends(model))
......
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