mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-14 04:15:10 +00:00
fix: item should not be a fixed asset if bom is phantom
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 () {
|
||||
return {
|
||||
query: "erpnext.manufacturing.doctype.bom.bom.item_query",
|
||||
filters: {
|
||||
is_stock_item: !frm.doc.is_phantom_bom,
|
||||
},
|
||||
};
|
||||
return frm.phantom_bom_filters;
|
||||
});
|
||||
|
||||
frm.set_query("project", function () {
|
||||
@@ -248,6 +249,12 @@ frappe.ui.form.on("BOM", {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user