mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Add a separate form for creating a sales order allocation
This commit is contained in:
		| @@ -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): | class EditSalesOrderAllocationForm(HelperForm): | ||||||
|  |     """ | ||||||
|  |     Form for editing a SalesOrderAllocation item | ||||||
|  |     """ | ||||||
|  |  | ||||||
|     quantity = RoundingDecimalFormField(max_digits=10, decimal_places=5) |     quantity = RoundingDecimalFormField(max_digits=10, decimal_places=5) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1295,7 +1295,7 @@ class SalesOrderAllocationCreate(AjaxCreateView): | |||||||
|     """ View for creating a new SalesOrderAllocation """ |     """ View for creating a new SalesOrderAllocation """ | ||||||
|  |  | ||||||
|     model = SalesOrderAllocation |     model = SalesOrderAllocation | ||||||
|     form_class = order_forms.EditSalesOrderAllocationForm |     form_class = order_forms.CreateSalesOrderAllocationForm | ||||||
|     ajax_form_title = _('Allocate Stock to Order') |     ajax_form_title = _('Allocate Stock to Order') | ||||||
|      |      | ||||||
|     def get_initial(self): |     def get_initial(self): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user