mirror of
https://github.com/frappe/erpnext.git
synced 2026-10-29 22:57:42 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user