Use INVENTREE_DEFAULT_CURRENCY as specified base currency

This commit is contained in:
Oliver Walters 2021-05-25 10:46:30 +10:00
parent 619cba6007
commit 0a26a06909
2 changed files with 5 additions and 4 deletions

View File

@ -513,9 +513,7 @@ CURRENCIES = CONFIG.get(
],
)
BASE_CURRENCY = CONFIG.get('base_currency', 'USD')
EXCHANGE_BACKEND = 'InvenTree.exchange.InvenTreeManualExchangeBackend'
EXCHANGE_BACKEND = 'InvenTree.exchange.ExchangeRateHostBackend'
# Extract email settings from the config file
email_config = CONFIG.get('email', {})

View File

@ -175,10 +175,13 @@ def update_exchange_rates():
return
backend = ExchangeRateHostBackend()
print(f"Updating exchange rates from {backend.url}")
currencies = ','.join(settings.CURRENCIES)
base = settings.BASE_CURRENCY
base = common.models.InvenTreeSetting.get_setting('INVENTREE_DEFAULT_CURRENCY')
print(f"Using base currency '{base}'")
backend.update_rates(base_currency=base, symbols=currencies)