2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 11:05:41 +00:00

Fix exchange rate updates (#5843)

- Handle base currencies which are not USD
- API changed "base_currency" to "base"
This commit is contained in:
Oliver
2023-11-03 11:58:39 +11:00
committed by GitHub
parent 5d55555394
commit a7c0882c02

View File

@ -51,7 +51,8 @@ class InvenTreeExchange(SimpleExchangeBackend):
rates = super().get_rates(**params) rates = super().get_rates(**params)
# Add the base currency to the rates # Add the base currency to the rates
rates[params["base_currency"]] = Decimal("1.0") base_currency = params.get('base', currency_code_default())
rates[base_currency] = Decimal("1.0")
return rates return rates