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)

--HG--
branch : 6.0
This commit is contained in:
Nicolas Évrard
2025-10-09 18:50:07 +02:00
parent 8086f5dacb
commit 9166f3a718
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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)) {
@@ -397,7 +397,8 @@ class Record(SignalEvent):
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