From 0aec896ebb7f475cea5af3f3017a1d7b305688d9 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 31 Oct 2025 16:58:29 +0530 Subject: [PATCH] fix: hourly rate not fetched on selction of workstation type --- erpnext/manufacturing/doctype/bom/bom.js | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js index 738ce0b94ee..5813593775d 100644 --- a/erpnext/manufacturing/doctype/bom/bom.js +++ b/erpnext/manufacturing/doctype/bom/bom.js @@ -833,6 +833,31 @@ frappe.ui.form.on("BOM Operation", "workstation", function (frm, cdt, cdn) { }); }); +frappe.ui.form.on("BOM Operation", "workstation_type", function (frm, cdt, cdn) { + var d = locals[cdt][cdn]; + if (!d.workstation_type) return; + frappe.call({ + method: "frappe.client.get", + args: { + doctype: "Workstation Type", + name: d.workstation_type, + }, + callback: function (data) { + frappe.model.set_value(d.doctype, d.name, "base_hour_rate", data.message.hour_rate); + frappe.model.set_value( + d.doctype, + d.name, + "hour_rate", + flt(flt(data.message.hour_rate) / flt(frm.doc.conversion_rate)), + 2 + ); + + erpnext.bom.calculate_op_cost(frm.doc); + erpnext.bom.calculate_total(frm.doc); + }, + }); +}); + frappe.ui.form.on("BOM Item", { do_not_explode: function (frm, cdt, cdn) { get_bom_material_detail(frm.doc, cdt, cdn, false);