fix: remove "scrap %" field (#31069)
This does nothing, there's scrap items table below that's actually used
for specifying scrap.
diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js
index 8a7634e..3d96f9c 100644
--- a/erpnext/manufacturing/doctype/bom/bom.js
+++ b/erpnext/manufacturing/doctype/bom/bom.js
@@ -499,15 +499,11 @@
cur_frm.cscript.rate = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
- var scrap_items = false;
-
- if(cdt == 'BOM Scrap Item') {
- scrap_items = true;
- }
+ const is_scrap_item = cdt == "BOM Scrap Item";
if (d.bom_no) {
frappe.msgprint(__("You cannot change the rate if BOM is mentioned against any Item."));
- get_bom_material_detail(doc, cdt, cdn, scrap_items);
+ get_bom_material_detail(doc, cdt, cdn, is_scrap_item);
} else {
erpnext.bom.calculate_rm_cost(doc);
erpnext.bom.calculate_scrap_materials_cost(doc);
diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.json b/erpnext/manufacturing/doctype/bom_item/bom_item.json
index 3406215..0a8ae7b 100644
--- a/erpnext/manufacturing/doctype/bom_item/bom_item.json
+++ b/erpnext/manufacturing/doctype/bom_item/bom_item.json
@@ -33,7 +33,6 @@
"amount",
"base_amount",
"section_break_18",
- "scrap",
"qty_consumed_per_unit",
"section_break_27",
"has_variants",
@@ -224,15 +223,6 @@
"fieldtype": "Section Break"
},
{
- "columns": 1,
- "fieldname": "scrap",
- "fieldtype": "Float",
- "label": "Scrap %",
- "oldfieldname": "scrap",
- "oldfieldtype": "Currency",
- "print_hide": 1
- },
- {
"fieldname": "qty_consumed_per_unit",
"fieldtype": "Float",
"hidden": 1,
@@ -298,7 +288,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
- "modified": "2022-01-24 16:57:57.020232",
+ "modified": "2022-05-19 02:32:43.785470",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM Item",
diff --git a/erpnext/manufacturing/report/bom_explorer/bom_explorer.py b/erpnext/manufacturing/report/bom_explorer/bom_explorer.py
index ac2f61c..2aa31be 100644
--- a/erpnext/manufacturing/report/bom_explorer/bom_explorer.py
+++ b/erpnext/manufacturing/report/bom_explorer/bom_explorer.py
@@ -21,7 +21,7 @@
exploded_items = frappe.get_all(
"BOM Item",
filters={"parent": bom},
- fields=["qty", "bom_no", "qty", "scrap", "item_code", "item_name", "description", "uom"],
+ fields=["qty", "bom_no", "qty", "item_code", "item_name", "description", "uom"],
)
for item in exploded_items:
@@ -37,7 +37,6 @@
"qty": item.qty * qty,
"uom": item.uom,
"description": item.description,
- "scrap": item.scrap,
}
)
if item.bom_no:
@@ -64,5 +63,4 @@
"fieldname": "description",
"width": 150,
},
- {"label": _("Scrap"), "fieldtype": "data", "fieldname": "scrap", "width": 100},
]