From 47772f4e7763161d01c6987207327cbf4d428107 Mon Sep 17 00:00:00 2001 From: sudarshan-g Date: Mon, 9 Mar 2026 13:32:59 +0530 Subject: [PATCH] feat: add cost center field to the stock entry accounting dimension tab --- erpnext/stock/doctype/stock_entry/stock_entry.js | 4 +++- erpnext/stock/doctype/stock_entry/stock_entry.json | 14 +++++++++++++- erpnext/stock/doctype/stock_entry/stock_entry.py | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 5d7704a6d03..d52bcab7802 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -564,7 +564,9 @@ frappe.ui.form.on("Stock Entry", { frm.fields_dict.items.grid.refresh(); frm.cscript.toggle_related_fields(frm.doc); }, - + cost_center(frm, cdt, cdn) { + erpnext.utils.copy_value_in_all_rows(frm.doc, cdt, cdn, "items", "cost_center"); + }, validate_purpose_consumption: function (frm) { frappe .call({ diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.json b/erpnext/stock/doctype/stock_entry/stock_entry.json index 7f889b04610..7c9dadb9a55 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.json +++ b/erpnext/stock/doctype/stock_entry/stock_entry.json @@ -65,6 +65,8 @@ "address_display", "accounting_dimensions_section", "project", + "column_break_wgvc", + "cost_center", "other_info_tab", "printing_settings", "select_print_heading", @@ -739,6 +741,16 @@ { "fieldname": "column_break_qpvo", "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_wgvc", + "fieldtype": "Column Break" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" } ], "grid_page_length": 50, @@ -747,7 +759,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2026-02-06 19:26:59.518312", + "modified": "2026-03-04 19:03:23.426082", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry", diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index febeafdcb31..5de58b4354b 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -107,6 +107,7 @@ class StockEntry(StockController, SubcontractingInwardController): asset_repair: DF.Link | None bom_no: DF.Link | None company: DF.Link + cost_center: DF.Link | None credit_note: DF.Link | None delivery_note_no: DF.Link | None fg_completed_qty: DF.Float