mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
use the default currency in forms
This commit is contained in:
parent
92f77b6bbb
commit
d87592aedb
@ -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'),
|
||||
|
@ -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,
|
||||
|
@ -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'),
|
||||
|
@ -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'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user