diff --git a/src/view/tree.js b/src/view/tree.js index ac2020cfac..bfe3e3ac94 100644 --- a/src/view/tree.js +++ b/src/view/tree.js @@ -1061,7 +1061,7 @@ var row_id_path = this.get_id_path(); this.set_selection(Sao.common.contains(selected, row_id_path)); if (this.children_field) { - this.record.load(this.children_field).done(function() { + var update_expander = function() { var children = this.record.field_get_client( this.children_field); if (this.is_expanded() || @@ -1078,7 +1078,12 @@ length ? 'visible' : 'hidden'); this.update_expander(false); } - }.bind(this)); + }.bind(this); + if (!this.record.is_loaded(this.children_field)) { + this.record.load(this.children_field).done(update_expander); + } else { + update_expander(); + } } if (this.record.deleted || this.record.removed) { this.el.css('text-decoration', 'line-through');