Skip to content
Permalink
Browse files

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

closes #36605

X-original-commit: 32ca799
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
  • Loading branch information...
rco-odoo authored and fw-bot committed Sep 9, 2019
1 parent 091aa33 commit 79386c2eb14386f4decdbeaf59b7e0487e485428
Showing with 6 additions and 0 deletions.
  1. +6 −0 odoo/models.py
@@ -2469,6 +2469,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 79386c2

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