From 889f9577d4a60d4becb7deb09d028789d5bccdd0 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 16 Jul 2019 20:55:40 +0530 Subject: [PATCH] fix: Render list count with children --- frappe/public/js/frappe/list/list_view.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index 1e6911abd2..034cd91b42 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -655,7 +655,9 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { } get_count_str() { - const current_count = this.data.length; + let current_count = this.data.length; + let count_without_children = this.data.uniqBy(d => d.name).length; + const filters = this.get_filters_for_args(); const with_child_table_filter = filters.some(filter => { return filter[0] !== this.doctype; @@ -676,7 +678,10 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { } }).then(r => { this.total_count = r.message.values[0][0] || current_count; - const str = __('{0} of {1}', [current_count, this.total_count]); + let str = __('{0} of {1}', [current_count, this.total_count]); + if (count_without_children !== current_count) { + str = __('{0} of {1} ({2} rows with children)', [count_without_children, this.total_count, current_count]); + } return str; }); }