Merge pull request #50554 from frappe/mergify/bp/version-15-hotfix/pr-50540

fix(stock-entry): prevent default warehouse from overriding parent warehouse (backport #50540)
This commit is contained in:
ruthra kumar
2025-11-18 15:09:08 +05:30
committed by GitHub

View File

@@ -1338,8 +1338,8 @@ erpnext.stock.StockEntry = class StockEntry extends erpnext.stock.StockControlle
this.frm.script_manager.copy_from_first_row("items", row, ["expense_account", "cost_center"]);
}
if (!row.s_warehouse) row.s_warehouse = this.frm.doc.from_warehouse;
if (!row.t_warehouse) row.t_warehouse = this.frm.doc.to_warehouse;
if (this.frm.doc.from_warehouse) row.s_warehouse = this.frm.doc.from_warehouse;
if (this.frm.doc.to_warehouse) row.t_warehouse = this.frm.doc.to_warehouse;
if (cint(frappe.user_defaults?.use_serial_batch_fields)) {
frappe.model.set_value(row.doctype, row.name, "use_serial_batch_fields", 1);