Skip to content

Commit c7928a0

Browse files
kavin-114mergify[bot]
authored andcommitted
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 4335318)
1 parent bffb7cf commit c7928a0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

erpnext/controllers/selling_controller.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,10 @@ def throw_message(idx, item_name, rate, ref_rate_field):
333333
if is_internal_customer or not is_stock_item:
334334
continue
335335

336-
if item.get("incoming_rate") and item.base_net_rate < (
336+
rate_field = "valuation_rate" if self.doctype in ["Sales Order", "Quotation"] else "incoming_rate"
337+
if item.get(rate_field) and item.base_net_rate < (
337338
valuation_rate := flt(
338-
item.incoming_rate * (item.conversion_factor or 1), item.precision("base_net_rate")
339+
item.get(rate_field) * (item.conversion_factor or 1), item.precision("base_net_rate")
339340
)
340341
):
341342
throw_message(

0 commit comments

Comments
 (0)