From 1e20358c28d3929dd862feb05025ee566a4e2285 Mon Sep 17 00:00:00 2001 From: Devin Slauenwhite Date: Thu, 14 Jul 2022 18:53:50 -0400 Subject: [PATCH] fix: sum stock_value and group by warehouse --- .../warehouse_wise_stock_value/warehouse_wise_stock_value.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py b/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py index 5bb6446101..d488150eef 100644 --- a/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py +++ b/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py @@ -33,8 +33,9 @@ def get( warehouses = frappe.get_list( "Bin", - fields=["warehouse", "stock_value"], + fields=["warehouse", "sum(stock_value) stock_value"], filters={"warehouse": ["IN", warehouses], "stock_value": [">", 0]}, + group_by="warehouse", order_by="stock_value DESC", limit_page_length=10, )