Merge pull request #56998 from frappe/mergify/bp/version-16-hotfix/pr-56979

fix: update BOM operations when routing is changed (backport #56979)
This commit is contained in:
Mihir Kandoi
2026-07-09 20:52:54 +05:30
committed by GitHub

View File

@@ -586,7 +586,11 @@ frappe.ui.form.on("BOM", {
},
routing(frm) {
if (frm.doc.routing && frm.doc.with_operations && !frm.doc.operations.length) {
// Refetch operations whenever the routing is (re)selected, so that
// changing the routing - e.g. on a new BOM version copied from another
// BOM - replaces the operations with those of the newly selected routing
// instead of keeping the old ones.
if (frm.doc.routing && frm.doc.with_operations) {
frappe.call({
doc: frm.doc,
method: "get_routing",