changeset 43be33d4329c in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=43be33d4329c
description:
        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
diffstat:

 tryton/gui/window/view_form/model/field.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 4d1088d51219 -r 43be33d4329c tryton/gui/window/view_form/model/field.py
--- a/tryton/gui/window/view_form/model/field.py        Mon Apr 25 23:20:58 
2022 +0200
+++ b/tryton/gui/window/view_form/model/field.py        Mon Apr 25 23:22:20 
2022 +0200
@@ -184,7 +184,8 @@
             elif key in self.attrs:
                 self.get_state_attrs(record)[key] = self.attrs[key]
         if (record.group.readonly
-                or self.get_state_attrs(record).get('domain_readonly')):
+                or self.get_state_attrs(record).get('domain_readonly')
+                or record.parent_name == self.name):
             self.get_state_attrs(record)['readonly'] = True
 
     def get_state_attrs(self, record):

Reply via email to