mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 03:15:07 +00:00
Merge pull request #46615 from frappe/mergify/bp/version-15-hotfix/pr-46608
fix: fetch bom_no when updating items in sales order (backport #46608)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -692,7 +692,7 @@ erpnext.utils.update_child_items = function (opts) {
|
||||
},
|
||||
callback: function (r) {
|
||||
if (r.message) {
|
||||
const { qty, price_list_rate: rate, uom, conversion_factor } = r.message;
|
||||
const { qty, price_list_rate: rate, uom, conversion_factor, bom_no } = r.message;
|
||||
|
||||
const row = dialog.fields_dict.trans_items.df.data.find(
|
||||
(doc) => doc.idx == me.doc.idx
|
||||
@@ -703,6 +703,7 @@ erpnext.utils.update_child_items = function (opts) {
|
||||
uom: me.doc.uom || uom,
|
||||
qty: me.doc.qty || qty,
|
||||
rate: me.doc.rate || rate,
|
||||
bom_no: bom_no,
|
||||
});
|
||||
dialog.fields_dict.trans_items.grid.refresh();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user