From 2029a9fa71cf96b1df3aed12e0e6120895b7b754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Thu, 9 Oct 2025 18:50:07 +0200 Subject: [PATCH] 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 --- sao/src/model.js | 2 +- tryton/tryton/gui/window/view_form/model/record.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sao/src/model.js b/sao/src/model.js index 7f6a6229e6..3ed25bc37f 100644 --- a/sao/src/model.js +++ b/sao/src/model.js @@ -1334,7 +1334,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 --git a/tryton/tryton/gui/window/view_form/model/record.py b/tryton/tryton/gui/window/view_form/model/record.py index 614095a52a..b61c8d8aef 100644 --- a/tryton/tryton/gui/window/view_form/model/record.py +++ b/tryton/tryton/gui/window/view_form/model/record.py @@ -447,7 +447,8 @@ class Record: 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