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
This commit is contained in:
Nicolas Évrard
2025-10-09 18:50:07 +02:00
parent 354139725c
commit 2029a9fa71
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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)) {
@@ -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