minor: show BOM related operations (#19237)
This commit is contained in:
parent
be8f6f0d65
commit
f4245a2d9c
@ -91,6 +91,16 @@ frappe.ui.form.on("Work Order", {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
frm.set_query("operation", "required_items", function() {
|
||||||
|
return {
|
||||||
|
query: "erpnext.manufacturing.doctype.work_order.work_order.get_bom_operations",
|
||||||
|
filters: {
|
||||||
|
'parent': frm.doc.bom_no,
|
||||||
|
'parenttype': 'BOM'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
// formatter for work order operation
|
// formatter for work order operation
|
||||||
frm.set_indicator_formatter('operation',
|
frm.set_indicator_formatter('operation',
|
||||||
function(doc) { return (frm.doc.qty==doc.completed_qty) ? "green" : "orange"; });
|
function(doc) { return (frm.doc.qty==doc.completed_qty) ? "green" : "orange"; });
|
||||||
|
@ -543,6 +543,13 @@ class WorkOrder(Document):
|
|||||||
bom.set_bom_material_details()
|
bom.set_bom_material_details()
|
||||||
return bom
|
return bom
|
||||||
|
|
||||||
|
def get_bom_operations(doctype, txt, searchfield, start, page_len, filters):
|
||||||
|
if txt:
|
||||||
|
filters['operation'] = ('like', '%%%s%%' % txt)
|
||||||
|
|
||||||
|
return frappe.get_all('BOM Operation',
|
||||||
|
filters = filters, fields = ['operation'], as_list=1)
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_item_details(item, project = None):
|
def get_item_details(item, project = None):
|
||||||
res = frappe.db.sql("""
|
res = frappe.db.sql("""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user