2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-14 15:41:10 +00:00

Add a 'sales order' view for each part

This commit is contained in:
Oliver Walters
2020-04-21 09:15:01 +10:00
parent b204618e79
commit 3d2e907d5e
7 changed files with 81 additions and 4 deletions

View File

@@ -1,16 +1,17 @@
{% extends "part/part_base.html" %}
{% load static %}
{% load i18n %}
{% block details %}
{% include 'part/tabs.html' with tab='orders' %}
<h4>Part Orders</h4>
<h4>{% trans "Purchase Orders" %}</h4>
<hr>
<div id='button-bar'>
<div class='button-toolbar container-fluid' style='float: right;'>
<button class='btn btn-primary' type='button' id='part-order2' title='Order part'>Order Part</button>
<button class='btn btn-primary' type='button' id='part-order2' title='{% trans "Order part" %}'>{% trans "Order Part" %}</button>
<div class='filter-list' id='filter-list-order'>
<!-- An empty div in which the filter list will be constructed -->
</div>
@@ -27,7 +28,10 @@
{{ block.super }}
loadPurchaseOrderTable($("#purchase-order-table"), {
url: "{% url 'api-po-list' %}?part={{ part.id }}",
url: "{% url 'api-po-list' %}",
params: {
part: {{ part.id }},
},
});
$("#part-order2").click(function() {

View File

@@ -0,0 +1,36 @@
{% extends "part/part_base.html" %}
{% load static %}
{% load i18n %}
{% block details %}
{% include 'part/tabs.html' with tab='sales-orders' %}
<h4>{% trans "Sales Orders" %}</h4>
<hr>
<div id='button-bar'>
<div class='button-toolbar container-fluid' style='float: right;'>
<button class='btn btn-primary' type='button' id='part-order2' title='{% trans "New sales order" %}'>{% trans "New Order" %}</button>
<div class='filter-list' id='filter-list-order'>
<!-- An empty div in which the filter list will be constructed -->
</div>
</div>
</div>
<table class='table table-striped table-condensed po-table' id='sales-order-table' data-toolbar='#button-bar'>
</table>
{% endblock %}
{% block js_ready %}
{{ block.super }}
loadSalesOrderTable($("#sales-order-table"), {
url: "{% url 'api-so-list' %}",
params: {
part: {{ part.id }},
},
});
{% endblock %}

View File

@@ -43,6 +43,11 @@
<a href="{% url 'part-orders' part.id %}">{% trans "Purchase Orders" %} <span class='badge'>{{ part.purchase_orders|length }}</span></a>
</li>
{% endif %}
{% if part.salable %}
<li{% ifequal tab 'sales-orders' %} class='active'{% endifequal %}>
<a href="{% url 'part-sales-orders' part.id %}">{% trans "Sales Orders" %} <span class='badge'>{{ part.sales_orders|length }}</span></a>
</li>
{% endif %}
{% if part.trackable and 0 %}
<li{% ifequal tab 'track' %} class="active"{% endifequal %}>
<a href="{% url 'part-track' part.id %}">{% trans "Tracking" %}