mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 00:44:45 +00:00
Merge pull request #50984 from mihir-kandoi/phantom-bom-item-filter
This commit is contained in:
@@ -41,13 +41,14 @@ frappe.ui.form.on("BOM", {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
frm.phantom_bom_filters = {
|
||||||
|
query: "erpnext.manufacturing.doctype.bom.bom.item_query",
|
||||||
|
filters: {
|
||||||
|
is_stock_item: !frm.doc.is_phantom_bom,
|
||||||
|
},
|
||||||
|
};
|
||||||
frm.set_query("item", function () {
|
frm.set_query("item", function () {
|
||||||
return {
|
return frm.phantom_bom_filters;
|
||||||
query: "erpnext.manufacturing.doctype.bom.bom.item_query",
|
|
||||||
filters: {
|
|
||||||
is_stock_item: !frm.doc.is_phantom_bom,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
frm.set_query("project", function () {
|
frm.set_query("project", function () {
|
||||||
@@ -248,6 +249,12 @@ frappe.ui.form.on("BOM", {
|
|||||||
frappe.set_route("List", "Item", { variant_of: frm.doc.item });
|
frappe.set_route("List", "Item", { variant_of: frm.doc.item });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (frm.doc.is_phantom_bom) {
|
||||||
|
frm.phantom_bom_filters.filters.is_fixed_asset = 0;
|
||||||
|
} else {
|
||||||
|
delete frm.phantom_bom_filters.filters.is_fixed_asset;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
make_work_order(frm) {
|
make_work_order(frm) {
|
||||||
|
|||||||
Reference in New Issue
Block a user