From 8a3148eee63eb55881ccfdbc6a7e0da4142f057f Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 2 Dec 2025 21:49:03 +0530 Subject: [PATCH] fix: cost center not reset (cherry picked from commit 29f2ecbd6f184cc1d6ce29a1b480b61982da190b) --- erpnext/public/js/controllers/transaction.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 3abcde36072..f61de798390 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1093,6 +1093,14 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe this.frm.refresh_field("payment_schedule"); } + cost_center(doc) { + this.frm.doc.items.forEach((item) => { + item.cost_center = doc.cost_center; + }); + + this.frm.refresh_field("items"); + } + due_date(doc, cdt, cdn) { // due_date is to be changed, payment terms template and/or payment schedule must // be removed as due_date is automatically changed based on payment terms