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
This commit is contained in:
Cédric Krier
2026-05-21 17:54:51 +02:00
parent cf19c35b42
commit 0421ed1d0a
2 changed files with 13 additions and 0 deletions
+6
View File
@@ -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
+7
View File
@@ -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),