[minor] [production planning tool] include non production items without default BOM in multi-level BOM
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
index 0fb1e34..c907339 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
@@ -247,8 +247,8 @@
fb.description, fb.stock_uom, it.min_order_qty
from `tabBOM Explosion Item` fb, `tabBOM` bom, `tabItem` it
where bom.name = fb.parent and it.name = fb.item_code
- and is_pro_applicable = 0
- and is_sub_contracted_item = 0
+ and (is_pro_applicable = 0 or ifnull(default_bom, "")="")
+ and (is_sub_contracted_item = 0 or ifnull(default_bom, "")="")
and is_stock_item = 1
and fb.docstatus<2 and bom.name=%s
group by item_code, stock_uom""", bom, as_dict=1):
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index 739f934..d712cc9 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -14,12 +14,24 @@
refresh: function(frm) {
if(frm.doc.is_stock_item) {
- frm.add_custom_button(__("Show Balance"), function() {
+ frm.add_custom_button(__("Balance"), function() {
frappe.route_options = {
"item_code": frm.doc.name
}
frappe.set_route("query-report", "Stock Balance");
});
+ frm.add_custom_button(__("Ledger"), function() {
+ frappe.route_options = {
+ "item_code": frm.doc.name
+ }
+ frappe.set_route("query-report", "Stock Ledger");
+ });
+ frm.add_custom_button(__("Projected"), function() {
+ frappe.route_options = {
+ "item_code": frm.doc.name
+ }
+ frappe.set_route("query-report", "Stock Projected Qty");
+ });
}
// make sensitive fields(has_serial_no, is_stock_item, valuation_method)