mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add form to edit a SalesOrder
This commit is contained in:
parent
ce1dd88129
commit
e12824df2e
@ -107,4 +107,10 @@ InvenTree | {% trans "Sales Order" %}
|
||||
{% block js_ready %}
|
||||
{{ block.super }}
|
||||
|
||||
$("#edit-order").click(function() {
|
||||
launchModalForm("{% url 'so-edit' order.id %}", {
|
||||
reload: true,
|
||||
});
|
||||
});
|
||||
|
||||
{% endblock %}
|
@ -17,13 +17,13 @@ purchase_order_attachment_urls = [
|
||||
|
||||
purchase_order_detail_urls = [
|
||||
|
||||
url(r'^cancel/?', views.PurchaseOrderCancel.as_view(), name='po-cancel'),
|
||||
url(r'^edit/?', views.PurchaseOrderEdit.as_view(), name='po-edit'),
|
||||
url(r'^issue/?', views.PurchaseOrderIssue.as_view(), name='po-issue'),
|
||||
url(r'^receive/?', views.PurchaseOrderReceive.as_view(), name='po-receive'),
|
||||
url(r'^complete/?', views.PurchaseOrderComplete.as_view(), name='po-complete'),
|
||||
url(r'^cancel/', views.PurchaseOrderCancel.as_view(), name='po-cancel'),
|
||||
url(r'^edit/', views.PurchaseOrderEdit.as_view(), name='po-edit'),
|
||||
url(r'^issue/', views.PurchaseOrderIssue.as_view(), name='po-issue'),
|
||||
url(r'^receive/', views.PurchaseOrderReceive.as_view(), name='po-receive'),
|
||||
url(r'^complete/', views.PurchaseOrderComplete.as_view(), name='po-complete'),
|
||||
|
||||
url(r'^export/?', views.PurchaseOrderExport.as_view(), name='po-export'),
|
||||
url(r'^export/', views.PurchaseOrderExport.as_view(), name='po-export'),
|
||||
|
||||
url(r'^notes/', views.PurchaseOrderNotes.as_view(), name='po-notes'),
|
||||
|
||||
@ -63,6 +63,8 @@ purchase_order_urls = [
|
||||
|
||||
sales_order_detail_urls = [
|
||||
|
||||
url(r'^edit/', views.SalesOrderEdit.as_view(), name='so-edit'),
|
||||
|
||||
url(r'^.*$', views.SalesOrderDetail.as_view(), name='so-detail'),
|
||||
]
|
||||
|
||||
|
@ -265,6 +265,24 @@ class PurchaseOrderEdit(AjaxUpdateView):
|
||||
return form
|
||||
|
||||
|
||||
class SalesOrderEdit(AjaxUpdateView):
|
||||
""" View for editing a SalesOrder """
|
||||
|
||||
model = SalesOrder
|
||||
ajax_form_title = _('Edit Sales Order')
|
||||
form_class = order_forms.EditSalesOrderForm
|
||||
|
||||
def get_form(self):
|
||||
form = super().get_form()
|
||||
|
||||
order = self.get_object()
|
||||
|
||||
# Prevent user from editing customer
|
||||
form.fields['customer'].widget = HiddenInput()
|
||||
|
||||
return form
|
||||
|
||||
|
||||
class PurchaseOrderCancel(AjaxUpdateView):
|
||||
""" View for cancelling a purchase order """
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user