[fix] fix get query for sub warehouse in reorder level table
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index 8ee3d03..713789b 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -187,11 +187,17 @@
frm.fields_dict.reorder_levels.grid.get_field("warehouse").get_query = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
+
+ var filters = {
+ "is_group": 0
+ }
+
+ if (d.parent_warehouse) {
+ filters.extend({"parent_warehouse": d.warehouse_group})
+ }
+
return {
- filters: {
- "is_group": 0,
- "parent_warehouse": d.warehouse_group
- }
+ filters: filters
}
}