From fa04e368d3e32452f45b49863bb40d7a2136daaa Mon Sep 17 00:00:00 2001 From: Imesha Sudasingha Date: Mon, 15 Dec 2025 20:23:06 +0530 Subject: [PATCH] fix: preserve user-entered exchange rates in ERR journal entries The JE creation was overriding exchange_rate=1 with the system rate. Set ignore_exchange_rate flag to preserve user values. --- .../exchange_rate_revaluation/exchange_rate_revaluation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py index c08bd3878d5..2bb7aef8b99 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py @@ -485,6 +485,9 @@ class ExchangeRateRevaluation(Document): journal_entry.posting_date = self.posting_date journal_entry.multi_currency = 1 + # Prevent JE from overriding user-entered exchange rates (e.g., rate of 1) + journal_entry.flags.ignore_exchange_rate = True + journal_entry_accounts = [] for d in accounts: if not flt(d.get("balance_in_account_currency"), d.precision("balance_in_account_currency")):