fix: sum stock_value and group by warehouse

This commit is contained in:
Devin Slauenwhite 2022-07-14 18:53:50 -04:00
parent bc3023318e
commit 1e20358c28

View File

@ -33,8 +33,9 @@ def get(
warehouses = frappe.get_list( warehouses = frappe.get_list(
"Bin", "Bin",
fields=["warehouse", "stock_value"], fields=["warehouse", "sum(stock_value) stock_value"],
filters={"warehouse": ["IN", warehouses], "stock_value": [">", 0]}, filters={"warehouse": ["IN", warehouses], "stock_value": [">", 0]},
group_by="warehouse",
order_by="stock_value DESC", order_by="stock_value DESC",
limit_page_length=10, limit_page_length=10,
) )