From 01d444279c35b3ee6c7f04c7f250d5f360105e97 Mon Sep 17 00:00:00 2001
From: Oliver Walters <oliver.henry.walters@gmail.com>
Date: Tue, 18 May 2021 22:11:24 +1000
Subject: [PATCH] Add setting for fixer.io API key

---
 InvenTree/common/models.py                         | 6 ++++++
 InvenTree/templates/InvenTree/settings/global.html | 1 +
 2 files changed, 7 insertions(+)

diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py
index 99712b2a93..e499e9b801 100644
--- a/InvenTree/common/models.py
+++ b/InvenTree/common/models.py
@@ -87,6 +87,12 @@ class InvenTreeSetting(models.Model):
             'choices': djmoney.settings.CURRENCY_CHOICES,
         },
 
+        'INVENTREE_FIXER_API_KEY': {
+            'name': _('fixer.io API key'),
+            'description': _('API key for fixer.io currency conversion service'),
+            'default': '',
+        },
+
         'INVENTREE_DOWNLOAD_FROM_URL': {
             'name': _('Download from URL'),
             'description': _('Allow download of remote images and files from external URL'),
diff --git a/InvenTree/templates/InvenTree/settings/global.html b/InvenTree/templates/InvenTree/settings/global.html
index a0347490d0..5c5dccfb2a 100644
--- a/InvenTree/templates/InvenTree/settings/global.html
+++ b/InvenTree/templates/InvenTree/settings/global.html
@@ -20,6 +20,7 @@
         {% include "InvenTree/settings/setting.html" with key="INVENTREE_BASE_URL" icon="fa-globe" %}
         {% include "InvenTree/settings/setting.html" with key="INVENTREE_COMPANY_NAME" icon="fa-building" %}
         {% include "InvenTree/settings/setting.html" with key="INVENTREE_DEFAULT_CURRENCY" icon="fa-dollar-sign" %}
+        {% include "InvenTree/settings/setting.html" with key="INVENTREE_FIXER_API_KEY" icon="fa-key" %}
         {% include "InvenTree/settings/setting.html" with key="INVENTREE_DOWNLOAD_FROM_URL" icon="fa-cloud-download-alt" %}
     </tbody>
 </table>