From fd82c7d691c5788494cd536db81d29b76ca82e78 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 11:58:32 +0000 Subject: [PATCH] fix: new docs should refetch incoming rates (backport #58097) (#58294) Co-authored-by: Mihir Kandoi --- erpnext/controllers/selling_controller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index f1e3baebc51..fd5b564b6b0 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -560,7 +560,8 @@ class SellingController(StockController): reset_incoming_rate() if ( - not d.incoming_rate + (not d.incoming_rate or self.is_new()) + and not is_standalone or self.is_internal_transfer() or (get_valuation_method(d.item_code) == "Moving Average" and self.get("is_return")) ):