From d5cc51b426984a34b1ed654f81ea880a8473dc4f Mon Sep 17 00:00:00 2001 From: kavin-114 Date: Tue, 3 Mar 2026 19:41:50 +0530 Subject: [PATCH] fix(selling): handle selling price validation for FG item System checks valuation rate in incoming_rate field, since SO has it in valuation_rate field of item row, need to handle the field name dynamically based upon the doctype name in Selling Controller. (cherry picked from commit 433531848259db472715f9f8991a4537c1a75710) --- erpnext/controllers/selling_controller.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index a8c4a2733fc..acdea69cf22 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -318,9 +318,10 @@ class SellingController(StockController): if is_internal_customer or not is_stock_item: continue - if item.get("incoming_rate") and item.base_net_rate < ( + rate_field = "valuation_rate" if self.doctype in ["Sales Order", "Quotation"] else "incoming_rate" + if item.get(rate_field) and item.base_net_rate < ( valuation_rate := flt( - item.incoming_rate * (item.conversion_factor or 1), item.precision("base_net_rate") + item.get(rate_field) * (item.conversion_factor or 1), item.precision("base_net_rate") ) ): throw_message(