From e9b5f7cc8ee040d10ca06fe8794a4fca9a1b2fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 25 Apr 2022 23:22:20 +0200 Subject: [PATCH] Set as readonly the parent field When editing record from a tree, user can not change the field which contains the parent. He must rearrange the tree using the DnD or editing from a list. issue11022 review407281002 --- src/model.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/model.js b/src/model.js index f48215455d..de95765335 100644 --- a/src/model.js +++ b/src/model.js @@ -1619,7 +1619,8 @@ } } if (record.group.readonly || - this.get_state_attrs(record).domain_readonly) { + this.get_state_attrs(record).domain_readonly || + (record.parent_name == this.name)) { this.get_state_attrs(record).readonly = true; } },