fix: update packed item warehouses when the bundle warehouse changes (backport #58316)

Changing a bundle row's warehouse updates its packed items' warehouse.

(cherry picked from commit 2328e6da94)
This commit is contained in:
Mihir Kandoi
2026-10-15 14:13:51 +05:30
parent c3e0a9212d
commit 0622306863
+18
View File
@@ -276,6 +276,24 @@ erpnext.sales_common = {
}
this.set_actual_qty(doc, cdt, cdn);
if (cdt !== "Packed Item" && doc.packed_items) {
doc.packed_items
.filter(
(item) =>
item.parent_detail_docname === cdn ||
(/^\d+$/.test(String(item.parent_detail_docname)) &&
Number(item.parent_detail_docname) === locals[cdt][cdn].idx)
)
.forEach((item) => {
frappe.model.set_value(
item.doctype,
item.name,
"warehouse",
locals[cdt][cdn].warehouse
);
});
}
}
set_actual_qty(doc, cdt, cdn) {