From 104eac21e8f3c4a4fb01304b514fe2fdba30ff39 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 12:05:36 +0000 Subject: [PATCH] fix: zero valuation rate popup on SI (backport #54376) (#54377) fix: zero valuation rate popup on SI (#54376) (cherry picked from commit 3ef6c24f07c49506873fba6b16edec087eff24ec) Co-authored-by: Mihir Kandoi --- erpnext/controllers/stock_controller.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 05f2e18c878..5e883a6695c 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -142,14 +142,19 @@ class StockController(AccountsController): ]: for item in self.get("items"): if ( - (item.get("valuation_rate") == 0 or item.get("incoming_rate") == 0) + ( + item.get("valuation_rate") == 0 + or (item.get("incoming_rate") == 0 and self.get("update_stock", 1)) + ) and item.get("allow_zero_valuation_rate") == 0 and frappe.get_cached_value("Item", item.item_code, "is_stock_item") ): frappe.toast( - _( - "Row #{0}: Item {1} has zero rate but 'Allow Zero Valuation Rate' is not enabled." - ).format(item.idx, frappe.bold(item.item_code)), + _("Row #{0}: Item {1} has zero rate but '{2}' is not enabled.").format( + item.idx, + frappe.bold(item.item_code), + item.meta.get_label("allow_zero_valuation_rate"), + ), indicator="orange", )