details: https://code.tryton.org/tryton/commit/bdacef045996
branch: 7.0
user: Cédric Krier <[email protected]>
date: Thu May 21 17:54:51 2026 +0200
description:
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)
diffstat:
sao/src/view/list_form.js | 6 ++++++
sao/src/view/tree.js | 7 +++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diffs (33 lines):
diff -r f750d9d77333 -r bdacef045996 sao/src/view/list_form.js
--- a/sao/src/view/list_form.js Wed May 20 18:50:58 2026 +0200
+++ b/sao/src/view/list_form.js Thu May 21 17:54:51 2026 +0200
@@ -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 -r f750d9d77333 -r bdacef045996 sao/src/view/tree.js
--- a/sao/src/view/tree.js Wed May 20 18:50:58 2026 +0200
+++ b/sao/src/view/tree.js Thu May 21 17:54:51 2026 +0200
@@ -1345,6 +1345,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),