auto-fill price break with default quantity

This commit is contained in:
Oliver Walters 2020-03-31 22:11:16 +11:00
parent 9d19029ba9
commit 67a73c1fbf

View File

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