From 0421ed1d0a7f8ac29b4a289c2a4d8c01f1bed39b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 21 May 2026 17:54:51 +0200 Subject: [PATCH] Reset the selection when cursor is set with reset view The view is reset when a new record is displayed and on editable list or list-form, we want to have only the current record selected even if the selection checkbox is checked for all records. Closes #14858 (grafted from c4c84d6300fc4e02eeb7b731434cdf988cce45bc) --HG-- branch : 8.0 --- sao/src/view/list_form.js | 6 ++++++ sao/src/view/tree.js | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/sao/src/view/list_form.js b/sao/src/view/list_form.js index 76f3217d24..0be63468e6 100644 --- a/sao/src/view/list_form.js +++ b/sao/src/view/list_form.js @@ -115,6 +115,12 @@ return this.group.slice(); }, set_cursor: function(new_, reset_view) { + if (!this.record) { + return; + } + if (reset_view) { + this.display([this.record.id]); + } if (new_) { this.el.animate({ scrollTop: this.el[0].scrollHeight diff --git a/sao/src/view/tree.js b/sao/src/view/tree.js index 74bc05d5ad..baeb7af28b 100644 --- a/sao/src/view/tree.js +++ b/sao/src/view/tree.js @@ -1557,6 +1557,13 @@ this.display_size = this.group.length; this.display(); } + if (reset_view) { + let current_path = this.record.get_path(this.group); + current_path = current_path.map(function(e) { + return e[1]; + }); + this.display([current_path]); + } if (path.length > 1) { prm = this.rows[path[0]].expand_to_path( path.slice(1),