mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #691 from SchrodingersGat/default-currency
auto-fill price break with default quantity
This commit is contained in:
commit
40822a93df
@ -16,6 +16,8 @@ from InvenTree.views import AjaxCreateView, AjaxUpdateView, AjaxDeleteView
|
|||||||
from InvenTree.status_codes import OrderStatus
|
from InvenTree.status_codes import OrderStatus
|
||||||
from InvenTree.helpers import str2bool
|
from InvenTree.helpers import str2bool
|
||||||
|
|
||||||
|
from common.models import Currency
|
||||||
|
|
||||||
from .models import Company
|
from .models import Company
|
||||||
from .models import SupplierPart
|
from .models import SupplierPart
|
||||||
from .models import SupplierPriceBreak
|
from .models import SupplierPriceBreak
|
||||||
@ -330,6 +332,13 @@ class PriceBreakCreate(AjaxCreateView):
|
|||||||
|
|
||||||
initials['part'] = self.get_part()
|
initials['part'] = self.get_part()
|
||||||
|
|
||||||
|
# Pre-select the default currency
|
||||||
|
try:
|
||||||
|
base = Currency.objects.get(base=True)
|
||||||
|
initials['currency'] = base
|
||||||
|
except Currency.DoesNotExist:
|
||||||
|
pass
|
||||||
|
|
||||||
return initials
|
return initials
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user