fix: Tree Report buttons state not matching initial_depth (#34505)

This commit is contained in:
El-Shafei H. 2025-12-24 11:25:17 +03:00 committed by GitHub
parent 6aa02d9f3c
commit b81939d1f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2160,8 +2160,13 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
</div>
</div>`);
$(this.$report_footer).append(this.$tree_footer);
this.$tree_footer.find("[data-action=collapse_all_rows]").show();
this.$tree_footer.find("[data-action=expand_all_rows]").hide();
if (this.report_settings.initial_depth == 0) {
this.$tree_footer.find("[data-action=expand_all_rows]").show();
this.$tree_footer.find("[data-action=collapse_all_rows]").hide();
} else {
this.$tree_footer.find("[data-action=collapse_all_rows]").show();
this.$tree_footer.find("[data-action=expand_all_rows]").hide();
}
}
const message = __(