[minor] [production planning tool] include non production items without default BOM in multi-level BOM
This commit is contained in:
parent
7be2e985b0
commit
e1f8b1d695
@ -247,8 +247,8 @@ class ProductionPlanningTool(Document):
|
|||||||
fb.description, fb.stock_uom, it.min_order_qty
|
fb.description, fb.stock_uom, it.min_order_qty
|
||||||
from `tabBOM Explosion Item` fb, `tabBOM` bom, `tabItem` it
|
from `tabBOM Explosion Item` fb, `tabBOM` bom, `tabItem` it
|
||||||
where bom.name = fb.parent and it.name = fb.item_code
|
where bom.name = fb.parent and it.name = fb.item_code
|
||||||
and is_pro_applicable = 0
|
and (is_pro_applicable = 0 or ifnull(default_bom, "")="")
|
||||||
and is_sub_contracted_item = 0
|
and (is_sub_contracted_item = 0 or ifnull(default_bom, "")="")
|
||||||
and is_stock_item = 1
|
and is_stock_item = 1
|
||||||
and fb.docstatus<2 and bom.name=%s
|
and fb.docstatus<2 and bom.name=%s
|
||||||
group by item_code, stock_uom""", bom, as_dict=1):
|
group by item_code, stock_uom""", bom, as_dict=1):
|
||||||
|
@ -14,12 +14,24 @@ frappe.ui.form.on("Item", {
|
|||||||
|
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
if(frm.doc.is_stock_item) {
|
if(frm.doc.is_stock_item) {
|
||||||
frm.add_custom_button(__("Show Balance"), function() {
|
frm.add_custom_button(__("Balance"), function() {
|
||||||
frappe.route_options = {
|
frappe.route_options = {
|
||||||
"item_code": frm.doc.name
|
"item_code": frm.doc.name
|
||||||
}
|
}
|
||||||
frappe.set_route("query-report", "Stock Balance");
|
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)
|
// make sensitive fields(has_serial_no, is_stock_item, valuation_method)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user