diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index 236e48770f..ec76475901 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -703,7 +703,7 @@ class PriceBreak(models.Model): price = MoneyField( max_digits=19, decimal_places=4, - default_currency='USD', + default_currency=currency_code_default(), null=True, verbose_name=_('Price'), help_text=_('Unit price at specified quantity'), diff --git a/InvenTree/company/forms.py b/InvenTree/company/forms.py index 62a46fcd6f..fc409b9a77 100644 --- a/InvenTree/company/forms.py +++ b/InvenTree/company/forms.py @@ -15,6 +15,7 @@ import djmoney.settings from djmoney.forms.fields import MoneyField import common.settings +from common.settings import currency_code_default from .models import Company from .models import ManufacturerPart @@ -38,7 +39,7 @@ class EditCompanyForm(HelperForm): label=_('Currency'), help_text=_('Default currency used for this company'), choices=[('', '----------')] + djmoney.settings.CURRENCY_CHOICES, - initial=common.settings.currency_code_default, + initial=currency_code_default, ) class Meta: @@ -116,7 +117,7 @@ class EditSupplierPartForm(HelperForm): single_pricing = MoneyField( label=_('Single Price'), - default_currency='USD', + default_currency=currency_code_default(), help_text=_('Single quantity price'), decimal_places=4, max_digits=19, diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py index fb169e0536..49504b6d89 100644 --- a/InvenTree/order/models.py +++ b/InvenTree/order/models.py @@ -17,6 +17,8 @@ from django.contrib.auth.models import User from django.urls import reverse from django.utils.translation import ugettext_lazy as _ +from common.settings import currency_code_default + from markdownx.models import MarkdownxField from djmoney.models.fields import MoneyField @@ -664,7 +666,7 @@ class PurchaseOrderLineItem(OrderLineItem): purchase_price = MoneyField( max_digits=19, decimal_places=4, - default_currency='USD', + default_currency=currency_code_default(), null=True, blank=True, verbose_name=_('Purchase Price'), help_text=_('Unit purchase price'), @@ -693,7 +695,7 @@ class SalesOrderLineItem(OrderLineItem): sale_price = MoneyField( max_digits=19, decimal_places=4, - default_currency='USD', + default_currency=currency_code_default(), null=True, blank=True, verbose_name=_('Sale Price'), help_text=_('Unit sale price'), diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 88f8dd081c..9786b360d9 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -20,6 +20,8 @@ from django.contrib.auth.models import User from django.db.models.signals import pre_delete from django.dispatch import receiver +from common.settings import currency_code_default + from markdownx.models import MarkdownxField from mptt.models import MPTTModel, TreeForeignKey @@ -534,7 +536,7 @@ class StockItem(MPTTModel): purchase_price = MoneyField( max_digits=19, decimal_places=4, - default_currency='USD', + default_currency=currency_code_default(), blank=True, null=True, verbose_name=_('Purchase Price'),