Set readonly Screen of One2Many when parent group is readonly

The user must not be allowed to modify records of a One2Many if the parent
record can not be saved.

Closes #13923
This commit is contained in:
Cédric Krier committed 2025-03-15 15:47:29 +01:00
1 parent 5bc3c53f6b
commit 9557984b3f
4 files changed
+4

No files matched your search

+1
View File
@@ -1249,6 +1249,7 @@
}
}
this.group.exclude_field = this.exclude_field;
this.group.readonly = this.__readonly;
},
new_group: function(context) {
if (!context) {
+1
View File
@@ -3442,6 +3442,7 @@ function eval_pyson(value){
order: attributes.order,
row_activate: this.activate.bind(this),
exclude_field: attributes.relation_field || null,
readonly: this.view.screen.group.readonly,
limit: null,
context: this.view.screen.context,
pre_validate: attributes.pre_validate,
@@ -429,6 +429,7 @@ class Screen:
for name, views in fields_views.items():
self.__group.fields[name].views.update(views)
self.__group.exclude_field = self.exclude_field
self.__group.readonly = self.__readonly
group = property(__get_group, __set_group)
@@ -166,6 +166,7 @@ class One2Many(Widget):
order=attrs.get('order'),
row_activate=self._on_activate,
exclude_field=attrs.get('relation_field', None),
readonly=self.view.screen.group.readonly,
limit=None,
context=self.view.screen.context,
breadcrumb=breadcrumb)