2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-04 20:51:00 +00:00

use the default currency in forms

This commit is contained in:
2021-06-05 13:22:11 +02:00
parent 92f77b6bbb
commit d87592aedb
4 changed files with 11 additions and 6 deletions

View File

@ -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,