Skip to content
Browse files

[FIX] models: `_rec_name` when field `x_name` is discarded

closes #36612

X-original-commit: 32ca799
Signed-off-by: Nicolas Martinelli (nim) <>
  • Loading branch information...
rco-odoo authored and fw-bot committed Sep 9, 2019
1 parent 01fe5da commit 93c6238bf6b7cde8001061e96af0cf6f07c38ba9
Showing with 6 additions and 0 deletions.
  1. +6 −0 odoo/
@@ -2630,6 +2630,12 @@ def _setup_fields(self):
del cls._fields[name]
delattr(cls, name)

# fix up _rec_name
if 'x_name' in bad_fields and cls._rec_name == 'x_name':
cls._rec_name = None
field = cls._fields['display_name']
field.depends = tuple(name for name in field.depends if name != 'x_name')

# map each field to the fields computed with the same method
groups = defaultdict(list)
for field in cls._fields.values():

0 comments on commit 93c6238

Please sign in to comment.
You can’t perform that action at this time.