fix(stock): keep mapped cost center in stock entry items (#59286)

(cherry picked from commit 7f608f31eb)
This commit is contained in:
Sudharsanan Ashok
2026-09-22 18:02:53 +05:30
committed by Mergify
parent 6af589208b
commit cdbdcc6e33

View File

@@ -1442,7 +1442,10 @@ erpnext.stock.StockEntry = class StockEntry extends erpnext.stock.StockControlle
this.frm.trigger("toggle_display_account_head");
erpnext.accounts.dimensions.update_dimension(this.frm, this.frm.doctype);
this.set_default_account("cost_center", "cost_center");
if (!this.frm.doc.__onload?.load_after_mapping) {
this.set_default_account("cost_center", "cost_center");
}
this.frm.refresh_fields("items");
}