mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add a separate form for creating a sales order allocation
This commit is contained in:
parent
88c1bc79d7
commit
cffe2ba84b
@ -211,7 +211,36 @@ class EditSalesOrderLineItemForm(HelperForm):
|
||||
]
|
||||
|
||||
|
||||
class CreateSalesOrderAllocationForm(HelperForm):
|
||||
"""
|
||||
Form for creating a SalesOrderAllocation item.
|
||||
|
||||
This can be allocated by selecting a specific stock item,
|
||||
or by providing a sequence of serial numbers
|
||||
"""
|
||||
|
||||
quantity = RoundingDecimalFormField(max_digits = 10, decimal_places=5)
|
||||
|
||||
serials = forms.CharField(
|
||||
label=_("Serial Numbers"),
|
||||
required=False,
|
||||
help_text=_('Enter stock serial numbers'),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = SalesOrderAllocation
|
||||
|
||||
fields = [
|
||||
'line',
|
||||
'item',
|
||||
'quantity',
|
||||
]
|
||||
|
||||
|
||||
class EditSalesOrderAllocationForm(HelperForm):
|
||||
"""
|
||||
Form for editing a SalesOrderAllocation item
|
||||
"""
|
||||
|
||||
quantity = RoundingDecimalFormField(max_digits=10, decimal_places=5)
|
||||
|
||||
|
@ -1295,7 +1295,7 @@ class SalesOrderAllocationCreate(AjaxCreateView):
|
||||
""" View for creating a new SalesOrderAllocation """
|
||||
|
||||
model = SalesOrderAllocation
|
||||
form_class = order_forms.EditSalesOrderAllocationForm
|
||||
form_class = order_forms.CreateSalesOrderAllocationForm
|
||||
ajax_form_title = _('Allocate Stock to Order')
|
||||
|
||||
def get_initial(self):
|
||||
|
Loading…
Reference in New Issue
Block a user