From c5fbebecb81d43dbd1050136fc2a1033fb2f6ca4 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 30 Oct 2025 15:51:52 +0530 Subject: [PATCH] fix: only show inventory accounts in the dropdown --- erpnext/stock/doctype/item/item.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 525b083f5f0..d113dc835b9 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -358,6 +358,17 @@ $.extend(erpnext.item, { }; }; + frm.fields_dict["item_defaults"].grid.get_field("default_inventory_account").get_query = function ( + doc, + cdt, + cdn + ) { + const row = locals[cdt][cdn]; + return { + filters: { company: row.company, account_type: "Stock", is_group: 0 }, + }; + }; + frm.fields_dict["item_defaults"].grid.get_field("default_discount_account").get_query = function ( doc, cdt,