mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 12:35:46 +00:00
Migrate views to use the API forms architecture:
- SalesOrderAllocationEdit - SalesOrderAllocationDelete
This commit is contained in:
@ -1,14 +0,0 @@
|
||||
{% extends "modal_delete_form.html" %}
|
||||
{% load i18n %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
{% block pre_form_content %}
|
||||
<div class='alert alert-block alert-warning'>
|
||||
{% trans "This action will unallocate the following stock from the Sales Order" %}:
|
||||
<br>
|
||||
<strong>
|
||||
{% decimal allocation.get_allocated %} x {{ allocation.line.part.full_name }}
|
||||
{% if allocation.item.location %} ({{ allocation.get_location }}){% endif %}
|
||||
</strong>
|
||||
</div>
|
||||
{% endblock %}
|
@ -45,10 +45,6 @@ sales_order_urls = [
|
||||
url(r'^allocation/', include([
|
||||
url(r'^new/', views.SalesOrderAllocationCreate.as_view(), name='so-allocation-create'),
|
||||
url(r'^assign-serials/', views.SalesOrderAssignSerials.as_view(), name='so-assign-serials'),
|
||||
url(r'(?P<pk>\d+)/', include([
|
||||
url(r'^edit/', views.SalesOrderAllocationEdit.as_view(), name='so-allocation-edit'),
|
||||
url(r'^delete/', views.SalesOrderAllocationDelete.as_view(), name='so-allocation-delete'),
|
||||
])),
|
||||
])),
|
||||
|
||||
# Display detail view for a single SalesOrder
|
||||
|
@ -1051,30 +1051,6 @@ class SalesOrderAllocationCreate(AjaxCreateView):
|
||||
return form
|
||||
|
||||
|
||||
class SalesOrderAllocationEdit(AjaxUpdateView):
|
||||
|
||||
model = SalesOrderAllocation
|
||||
form_class = order_forms.EditSalesOrderAllocationForm
|
||||
ajax_form_title = _('Edit Allocation Quantity')
|
||||
|
||||
def get_form(self):
|
||||
form = super().get_form()
|
||||
|
||||
# Prevent the user from editing particular fields
|
||||
form.fields.pop('item')
|
||||
form.fields.pop('line')
|
||||
|
||||
return form
|
||||
|
||||
|
||||
class SalesOrderAllocationDelete(AjaxDeleteView):
|
||||
|
||||
model = SalesOrderAllocation
|
||||
ajax_form_title = _("Remove allocation")
|
||||
context_object_name = 'allocation'
|
||||
ajax_template_name = "order/so_allocation_delete.html"
|
||||
|
||||
|
||||
class LineItemPricing(PartPricing):
|
||||
""" View for inspecting part pricing information """
|
||||
|
||||
|
Reference in New Issue
Block a user