fix: remove disabled warehouse in get_warehouses_based_on_account

This commit is contained in:
Mihir Kandoi
2025-11-20 15:42:27 +05:30
parent 0cb734d6a0
commit ff2d9bf4cb

View File

@@ -240,7 +240,9 @@ def get_child_warehouses(warehouse):
def get_warehouses_based_on_account(account, company=None):
warehouses = []
for d in frappe.get_all("Warehouse", fields=["name", "is_group"], filters={"account": account}):
for d in frappe.get_all(
"Warehouse", fields=["name", "is_group"], filters={"account": account, "disabled": 0}
):
if d.is_group:
warehouses.extend(get_child_warehouses(d.name))
else: