From ed0a5ea431076b2c4a4ebf6a2ec9c5336b378a68 Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Thu, 19 Aug 2021 17:53:12 +0200 Subject: [PATCH] [IMP] web: allow no open in x2m list view in form view Before this commit, when we set `no_open` in list view for x2m record in form view, the no_open is not take into account. Either the list is editable and then the form dialog is no displayed and the user can edit in the list or the list view is readonly and when the user clicks on a row in this list view, the form view dialog appears. This commit changes the condition in the `no_open` to force to set to true when the no_open is set to true. So, when the no_open=True even if the list view of x2m record is in readonly, the form view dialog is not called and thus it will no longer appear in this case. task-2379518 closes #73341 --- addons/web/static/src/legacy/js/fields/relational_fields.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/legacy/js/fields/relational_fields.js b/addons/web/static/src/legacy/js/fields/relational_fields.js index 880ca9aaf28..41d48f03f98 100644 --- a/addons/web/static/src/legacy/js/fields/relational_fields.js +++ b/addons/web/static/src/legacy/js/fields/relational_fields.js @@ -1486,8 +1486,8 @@ var FieldX2Many = AbstractField.extend(WidgetAdapterMixin, { addCreateLine: this._hasCreateLine(), addTrashIcon: this._hasTrashIcon(), isMany2Many: this.isMany2Many, - no_open: (this.isReadonly && !this.hasReadonlyModifier) && - (this._canQuickEdit || toBoolElse(arch.attrs.no_open || '', false)), + no_open: ((this.isReadonly && !this.hasReadonlyModifier) && + this._canQuickEdit) || toBoolElse(arch.attrs.no_open || '', false), columnInvisibleFields: this.currentColInvisibleFields, }); }