details: https://code.tryton.org/tryton/commit/4b4f8e95eb7c
branch: 7.4
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 77b73746d88a -r 4b4f8e95eb7c sao/src/model.js
--- a/sao/src/model.js Thu Oct 02 15:26:34 2025 +0200
+++ b/sao/src/model.js Thu Oct 09 18:50:07 2025 +0200
@@ -1319,7 +1319,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 77b73746d88a -r 4b4f8e95eb7c
tryton/tryton/gui/window/view_form/model/record.py
--- a/tryton/tryton/gui/window/view_form/model/record.py Thu Oct 02
15:26:34 2025 +0200
+++ b/tryton/tryton/gui/window/view_form/model/record.py Thu Oct 09
18:50:07 2025 +0200
@@ -444,7 +444,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