From 344e87db832875cb6dc0e0df4da570ecb4e7703e Mon Sep 17 00:00:00 2001 From: paurosello Date: Mon, 27 Mar 2017 11:50:34 +0200 Subject: [PATCH] Fix total sum report (#2921) * Fix total sum Removes last item if it is a Totals Row before loading more items * Update listing.js --- frappe/public/js/frappe/ui/listing.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/ui/listing.js b/frappe/public/js/frappe/ui/listing.js index 1876e4ccb1..437b16829f 100644 --- a/frappe/public/js/frappe/ui/listing.js +++ b/frappe/public/js/frappe/ui/listing.js @@ -324,6 +324,9 @@ frappe.ui.Listing = Class.extend({ } if(r.values.length || this.force_render_view) { + if (this.data.length && this.data[this.data.length - 1]._totals_row) { + this.data.pop(); + } this.data = this.data.concat(r.values); this.render_view(r.values); // this.render_list(r.values); @@ -463,4 +466,4 @@ frappe.ui.Listing = Class.extend({ } }); } -}); \ No newline at end of file +});