summaryrefslogtreecommitdiff
path: root/odoo/modules
diff options
context:
space:
mode:
authorHardik Prajapati <hap@odoo.com>2020-10-26 13:30:09 +0000
committerMitali Patel <mpa@odoo.com>2020-11-12 11:28:03 +0000
commitef1a02626c7d4d1e89d76e80b0275a01e15562dd (patch)
tree032d38d3a15fa5e74c9d7ebad09c0bd38441a31f /odoo/modules
parent3023c32e740907dcd356c3640993e83411160a3c (diff)
[FIX] registry: transitive dependencies of custom fields may not exist
Currently in 13.0 when creating a new model through studio and convert the x_name field to a computed fields with a dependency set on a custom field from a native model, user get a Key_error when upgrading or installing a new module due to the custom field with an invalid depends raise error through a transitive dependency. The loading of the registry completely fails, because the loading of the field custom_field raises a `KeyError` exception in `def transitive_dependencies` @ `dependencies[field]` it happens here because the custom_field was skipped at `dependencies[field] = set(field.resolve_depends(model))` task - 2366502 closes odoo/odoo#61658 X-original-commit: 92f6908bae4a6678f76a3ce9e29ac3907803ceb2 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'odoo/modules')
-rw-r--r--odoo/modules/registry.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/odoo/modules/registry.py b/odoo/modules/registry.py
index febae952129..e03d9ecf447 100644
--- a/odoo/modules/registry.py
+++ b/odoo/modules/registry.py
@@ -314,12 +314,10 @@ class Registry(Mapping):
def transitive_dependencies(field, seen=[]):
if field in seen:
return
- for seq1 in dependencies[field]:
+ for seq1 in dependencies.get(field, ()):
yield seq1
- exceptions = (Exception,) if field.base_field.manual else ()
- with ignore(*exceptions):
- for seq2 in transitive_dependencies(seq1[-1], seen + [field]):
- yield concat(seq1[:-1], seq2)
+ for seq2 in transitive_dependencies(seq1[-1], seen + [field]):
+ yield concat(seq1[:-1], seq2)
def concat(seq1, seq2):
if seq1 and seq2: