fix: fetch bom_no when updating items in sales order

This commit is contained in:
Mihir Kandoi
2025-03-19 12:52:34 +05:30
parent 0985441fc3
commit 508727a57a
3 changed files with 6 additions and 0 deletions

View File

@@ -3731,6 +3731,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

View File

@@ -713,6 +713,7 @@ erpnext.utils.update_child_items = function (opts) {
uom,
conversion_factor,
item_name,
default_bom,
} = r.message;
const row = dialog.fields_dict.trans_items.df.data.find(
@@ -725,6 +726,7 @@ erpnext.utils.update_child_items = function (opts) {
qty: me.doc.qty || qty,
rate: me.doc.rate || rate,
item_name: item_name,
bom_no: default_bom,
});
dialog.fields_dict.trans_items.grid.refresh();
}

View File

@@ -479,6 +479,7 @@ def get_basic_details(ctx: ItemDetailsCtx, item, overwrite_warehouse=True) -> It
"weight_per_unit": ctx.weight_per_unit or item.get("weight_per_unit"),
"weight_uom": ctx.weight_uom or item.get("weight_uom"),
"grant_commission": item.get("grant_commission"),
"default_bom": item.default_bom,
}
)