details:   https://code.tryton.org/tryton/commit/fe70996476b9
branch:    6.0
user:      Nicolas Évrard <[email protected]>
date:      Thu Oct 09 18:50:07 2025 +0200
description:
        Skip the validation of the parent field of group

        This is required because it can happen that a x2M field will have some 
records
        set through an on_change but if the x2M is not linked to a screen then
        exclude_field won't be set.

        Closes #14283
        (grafted from 1e7411d1bf84cdf75359e1ce9c5f4943fc50ad23)
diffstat:

 sao/src/model.js                                   |  2 +-
 tryton/tryton/gui/window/view_form/model/record.py |  3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r 7f07f544d468 -r fe70996476b9 sao/src/model.js
--- a/sao/src/model.js  Tue Sep 30 12:32:05 2025 +0200
+++ b/sao/src/model.js  Thu Oct 09 18:50:07 2025 +0200
@@ -1285,7 +1285,7 @@
                     if (field.description.readonly) {
                         continue;
                     }
-                    if (fname == this.group.exclude_field) {
+                    if ([this.group.exclude_field, 
this.group.parent_name].includes(fname)) {
                         continue;
                     }
                     if (!field.validate(this, softvalidation, pre_validate)) {
diff -r 7f07f544d468 -r fe70996476b9 
tryton/tryton/gui/window/view_form/model/record.py
--- a/tryton/tryton/gui/window/view_form/model/record.py        Tue Sep 30 
12:32:05 2025 +0200
+++ b/tryton/tryton/gui/window/view_form/model/record.py        Thu Oct 09 
18:50:07 2025 +0200
@@ -397,7 +397,8 @@
                 continue
             if field.attrs.get('readonly'):
                 continue
-            if field_name == self.group.exclude_field:
+            if field_name in {
+                    self.group.exclude_field, self.group.parent_name}:
                 continue
             if not field.validate(self, softvalidation, pre_validate):
                 res = False

Reply via email to