diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 94b553e2f99..eb483bdb868 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -3706,6 +3706,9 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil if d.get("schedule_date") and parent_doctype == "Purchase Order": child_item.schedule_date = d.get("schedule_date") + if d.get("bom_no") and parent_doctype == "Sales Order": + child_item.bom_no = d.get("bom_no") + if flt(child_item.price_list_rate): if flt(child_item.rate) > flt(child_item.price_list_rate): # if rate is greater than price_list_rate, set margin diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index cd851b57972..36320c787b6 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -692,7 +692,18 @@ erpnext.utils.update_child_items = function (opts) { }, callback: function (r) { if (r.message) { +<<<<<<< HEAD const { qty, price_list_rate: rate, uom, conversion_factor } = r.message; +======= + const { + qty, + price_list_rate: rate, + uom, + conversion_factor, + item_name, + default_bom, + } = r.message; +>>>>>>> 508727a57a (fix: fetch bom_no when updating items in sales order) const row = dialog.fields_dict.trans_items.df.data.find( (doc) => doc.idx == me.doc.idx @@ -703,6 +714,11 @@ erpnext.utils.update_child_items = function (opts) { uom: me.doc.uom || uom, qty: me.doc.qty || qty, rate: me.doc.rate || rate, +<<<<<<< HEAD +======= + item_name: item_name, + bom_no: default_bom, +>>>>>>> 508727a57a (fix: fetch bom_no when updating items in sales order) }); dialog.fields_dict.trans_items.grid.refresh(); } diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index ff87d159e36..2bed71a3e96 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -472,6 +472,7 @@ def get_basic_details(args, item, overwrite_warehouse=True): "weight_per_unit": args.get("weight_per_unit") or item.get("weight_per_unit"), "weight_uom": args.get("weight_uom") or item.get("weight_uom"), "grant_commission": item.get("grant_commission"), + "default_bom": item.default_bom, } )