Avoid create a promise for each row of a tree

issue8536
review283821003
This commit is contained in:
Cédric Krier committed 2019-08-12 12:54:18 +02:00
1 parent 5234481cdc
commit db1ff7f5ae
1 file changed
+7 -2
+7 -2
View File
@@ -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');