2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-23 07:10:55 +00:00

Add custom form template

This commit is contained in:
Oliver Walters
2021-03-30 00:10:28 +11:00
parent 19059ea4cf
commit 217097c9d3
4 changed files with 96 additions and 6 deletions

@ -220,25 +220,34 @@ class AllocateSerialsToSalesOrderForm(forms.Form):
"""
line = forms.ModelChoiceField(
queryset = SalesOrderLineItem.objects.all(),
queryset=SalesOrderLineItem.objects.all(),
)
part = forms.ModelChoiceField(
queryset = part.models.Part.objects.all(),
queryset=part.models.Part.objects.all(),
)
serials = forms.CharField(
label=_("Serial Numbers"),
required=False,
required=True,
help_text=_('Enter stock item serial numbers'),
)
quantity = forms.IntegerField(
label=_('Quantity'),
required=True,
help_text=_('Enter quantity of stock items'),
initial=1,
min_value=1
)
class Meta:
fields = [
'line',
'part',
'serials',
'quantity',
]
@ -247,7 +256,7 @@ class CreateSalesOrderAllocationForm(HelperForm):
Form for creating a SalesOrderAllocation item.
"""
quantity = RoundingDecimalFormField(max_digits = 10, decimal_places=5)
quantity = RoundingDecimalFormField(max_digits=10, decimal_places=5)
class Meta:
model = SalesOrderAllocation