From 6fe08428c13ee7839d640f347851cb8668d50607 Mon Sep 17 00:00:00 2001 From: Sudharsanan11 Date: Mon, 20 Apr 2026 04:18:09 +0530 Subject: [PATCH] fix(stock): ignore fetching warehouse account for asset items --- erpnext/controllers/stock_controller.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 01366d7bcc8..7ef893d1580 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -264,14 +264,15 @@ class StockController(AccountsController): ) is_asset_pr = any(d.get("is_fixed_asset") for d in self.get("items")) - - if ( + need_inventory_map = (self.get_stock_items() or self.get("packed_items")) and ( cint(erpnext.is_perpetual_inventory_enabled(self.company)) - or provisional_accounting_for_non_stock_items - or is_asset_pr - ): + ) + + inventory_account_map = frappe._dict() + if need_inventory_map: inventory_account_map = self.get_inventory_account_map() + if need_inventory_map or provisional_accounting_for_non_stock_items or is_asset_pr: if self.docstatus == 1: if not gl_entries: gl_entries = (