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),