From dbb9fbd9fde23bdd870096e9143192ac1c566057 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 1 Jul 2021 00:46:53 +0200 Subject: [PATCH] set default currency in field --- InvenTree/InvenTree/fields.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/InvenTree/InvenTree/fields.py b/InvenTree/InvenTree/fields.py index 25fbf77c90..9010203199 100644 --- a/InvenTree/InvenTree/fields.py +++ b/InvenTree/InvenTree/fields.py @@ -17,6 +17,7 @@ from djmoney.models.fields import MoneyField as ModelMoneyField from djmoney.forms.fields import MoneyField import InvenTree.helpers +from common.settings import currency_code_default class InvenTreeURLFormField(FormURLField): @@ -37,6 +38,10 @@ class InvenTreeURLField(models.URLField): class InvenTreeModelMoneyField(ModelMoneyField): + def __init__(self, **kwargs): + default_currency=currency_code_default + + super().__init__(default_currency=default_currency, **kwargs) pass