From ac73f7932cb246cf925b6932defd8db70df8eec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 7 Aug 2019 19:14:55 +0200 Subject: [PATCH] Do not display expander on record without children issue8518 review287811003 --- src/view/tree.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/view/tree.js b/src/view/tree.js index 6062098644..cc25bb4d81 100644 --- a/src/view/tree.js +++ b/src/view/tree.js @@ -1058,8 +1058,11 @@ this.set_selection(Sao.common.contains(selected, row_id_path)); if (this.children_field) { this.record.load(this.children_field).done(function() { + var children = this.record.field_get_client( + this.children_field); if (this.is_expanded() || - Sao.common.contains(expanded, row_id_path)) { + Sao.common.contains(expanded, row_id_path) && + !jQuery.isEmptyObject(children)) { this.expander.css('visibility', 'visible'); this.tree.expanded[this.path] = this; this.expand_children(selected, expanded);