diff --git a/InvenTree/company/templates/company/purchase_orders.html b/InvenTree/company/templates/company/purchase_orders.html index eac4066f2d..aa30dcd4d9 100644 --- a/InvenTree/company/templates/company/purchase_orders.html +++ b/InvenTree/company/templates/company/purchase_orders.html @@ -27,7 +27,10 @@ {{ block.super }} loadPurchaseOrderTable("#purchase-order-table", { - url: "{% url 'api-po-list' %}?supplier={{ company.id }}", + url: "{% url 'api-po-list' %}", + params: { + supplier: company.id, + } }); diff --git a/InvenTree/company/templates/company/sales_orders.html b/InvenTree/company/templates/company/sales_orders.html index 7d5c7684bc..b19ba563b2 100644 --- a/InvenTree/company/templates/company/sales_orders.html +++ b/InvenTree/company/templates/company/sales_orders.html @@ -27,7 +27,10 @@ {{ block.super }} loadSalesOrderTable("#sales-order-table", { - url: "{% url 'api-so-list' %}?customer={{ company.id }}", + url: "{% url 'api-so-list' %}", + params: { + customer: {{ company.id }}, + } }); diff --git a/InvenTree/order/templates/order/purchase_orders.html b/InvenTree/order/templates/order/purchase_orders.html index 54d57d2d8c..5e77c01181 100644 --- a/InvenTree/order/templates/order/purchase_orders.html +++ b/InvenTree/order/templates/order/purchase_orders.html @@ -4,17 +4,17 @@ {% load i18n %} {% block page_title %} -InvenTree | Purchase Orders +InvenTree | {% trans "Purchase Orders" %} {% endblock %} {% block content %} -

Purchase Orders

+

{% trans "Purchase Orders" %}


- +
diff --git a/InvenTree/order/templates/order/sales_orders.html b/InvenTree/order/templates/order/sales_orders.html new file mode 100644 index 0000000000..d8d5e22d4d --- /dev/null +++ b/InvenTree/order/templates/order/sales_orders.html @@ -0,0 +1,36 @@ +{% extends "base.html" %} + +{% load static %} +{% load i18n %} + +{% block page_title %} +InvenTree | {% trans "Sales Orders" %} +{% endblock %} + +{% block content %} + +

{% trans "Sales Orders" %}

+
+ +
+
+ +
+ +
+
+
+ + +
+ +{% endblock %} + +{% block js_ready %} +{{ block.super }} + +loadSalesOrderTable("#sales-order-table", { + url: "{% url 'api-so-list' %}", +}); + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/order/urls.py b/InvenTree/order/urls.py index 3346d7c44d..a81cfcf239 100644 --- a/InvenTree/order/urls.py +++ b/InvenTree/order/urls.py @@ -61,6 +61,11 @@ purchase_order_urls = [ url(r'^.*$', views.PurchaseOrderIndex.as_view(), name='po-index'), ] +sales_order_urls = [ + url(r'^.*$', views.SalesOrderIndex.as_view(), name='so-index'), +] + order_urls = [ url(r'^purchase-order/', include(purchase_order_urls)), + url(r'^sales-order/', include(sales_order_urls)), ] diff --git a/InvenTree/order/views.py b/InvenTree/order/views.py index 67d5b926d7..9e556e0321 100644 --- a/InvenTree/order/views.py +++ b/InvenTree/order/views.py @@ -16,6 +16,7 @@ import logging from decimal import Decimal, InvalidOperation from .models import PurchaseOrder, PurchaseOrderLineItem, PurchaseOrderAttachment +from .models import SalesOrder, SalesOrderLineItem, SalesOrderAttachment from .admin import POLineItemResource from build.models import Build from company.models import Company, SupplierPart @@ -55,6 +56,13 @@ class PurchaseOrderIndex(ListView): return ctx +class SalesOrderIndex(ListView): + + model = SalesOrder + template_name = 'order/sales_orders.html' + context_object_name = 'orders' + + class PurchaseOrderDetail(DetailView): """ Detail view for a PurchaseOrder object """