summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odoo/fields.py3
-rw-r--r--odoo/models.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/odoo/fields.py b/odoo/fields.py
index 60043915925..b472e35658b 100644
--- a/odoo/fields.py
+++ b/odoo/fields.py
@@ -320,6 +320,7 @@ class Field(object):
'automatic': False, # whether the field is automatically created ("magic" field)
'inherited': False, # whether the field is inherited (_inherits)
+ 'inherited_field': None, # the corresponding inherited field
'name': None, # name of the field
'model_name': None, # name of the model of this field
@@ -647,7 +648,7 @@ class Field(object):
@property
def base_field(self):
""" Return the base field of an inherited field, or ``self``. """
- return self.related_field.base_field if self.inherited else self
+ return self.inherited_field.base_field if self.inherited_field else self
#
# Company-dependent fields
diff --git a/odoo/models.py b/odoo/models.py
index f5c8a84595d..d04e6642254 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -2734,6 +2734,7 @@ class BaseModel(object):
# - copy inherited fields iff their original field is copied
fields[name] = field.new(
inherited=True,
+ inherited_field=field,
related=(parent_field, name),
related_sudo=False,
copy=field.copy,
@@ -2850,7 +2851,7 @@ class BaseModel(object):
try:
field.setup_full(self)
except Exception:
- if partial and field.manual:
+ if partial and field.base_field.manual:
# Something goes wrong when setup a manual field.
# This can happen with related fields using another manual many2one field
# that hasn't been loaded because the comodel does not exist yet.