Update erpnext/production/doctype/bill_of_materials/bill_of_materials.js
diff --git a/erpnext/production/doctype/bill_of_materials/bill_of_materials.js b/erpnext/production/doctype/bill_of_materials/bill_of_materials.js
index ae61147..c49a9bc 100644
--- a/erpnext/production/doctype/bill_of_materials/bill_of_materials.js
+++ b/erpnext/production/doctype/bill_of_materials/bill_of_materials.js
@@ -157,3 +157,8 @@
 	return 'SELECT DISTINCT `tabBill Of Materials`.`name`, `tabBill Of Materials`.`remarks` FROM `tabBill Of Materials` WHERE `tabBill Of Materials`.`item` = "' + d.item_code + '" AND `tabBill Of Materials`.`is_active` = "Yes" AND `tabBill Of Materials`.docstatus = 1 AND `tabBill Of Materials`.`name` like "%s" ORDER BY `tabBill Of Materials`.`name` LIMIT 50';
 }
 
+cur_frm.cscript.validate = function(doc, dt, dn) {
+	calculate_op_cost(doc, dt, dn);
+	calculate_rm_cost(doc, dt, dn);
+	calculate_total(doc);
+}
\ No newline at end of file