mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-27 02:28:30 +00:00
fix: stock module not opened when no warehouses
(cherry picked from commit 9de3b07223)
This commit is contained in:
committed by
Mergify
parent
211832104c
commit
3420e21d45
@@ -53,12 +53,14 @@ def get_stock_value_by_item_group(company):
|
|||||||
.inner_join(item_doctype)
|
.inner_join(item_doctype)
|
||||||
.on(doctype.item_code == item_doctype.name)
|
.on(doctype.item_code == item_doctype.name)
|
||||||
.select(item_doctype.item_group, stock_value.as_("stock_value"))
|
.select(item_doctype.item_group, stock_value.as_("stock_value"))
|
||||||
.where(doctype.warehouse.isin(warehouses))
|
|
||||||
.groupby(item_doctype.item_group)
|
.groupby(item_doctype.item_group)
|
||||||
.orderby(stock_value, order=frappe.qb.desc)
|
.orderby(stock_value, order=frappe.qb.desc)
|
||||||
.limit(10)
|
.limit(10)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if warehouses:
|
||||||
|
query = query.where(doctype.warehouse.isin(warehouses))
|
||||||
|
|
||||||
results = query.run(as_dict=True)
|
results = query.run(as_dict=True)
|
||||||
|
|
||||||
labels = []
|
labels = []
|
||||||
|
|||||||
Reference in New Issue
Block a user