mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add two new "build orders" tab to the "sales order" view
This commit is contained in:
parent
d5f3498238
commit
66b6036827
@ -260,8 +260,6 @@ function setupFilterList(tableKey, table, target) {
|
||||
|
||||
var element = $(target);
|
||||
|
||||
console.log(tableKey + " - " + element);
|
||||
|
||||
// One blank slate, please
|
||||
element.empty();
|
||||
|
||||
@ -302,8 +300,6 @@ function setupFilterList(tableKey, table, target) {
|
||||
element.find(`#filter-tag-${tableKey}`).on('change', function() {
|
||||
var list = element.find(`#filter-value-${tableKey}`);
|
||||
|
||||
console.log('index was changed!');
|
||||
|
||||
list.replaceWith(generateFilterInput(tableKey, this.value));
|
||||
});
|
||||
|
||||
|
30
InvenTree/order/templates/order/so_builds.html
Normal file
30
InvenTree/order/templates/order/so_builds.html
Normal file
@ -0,0 +1,30 @@
|
||||
{% extends "order/sales_order_base.html" %}
|
||||
|
||||
{% load inventree_extras %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block details %}
|
||||
|
||||
{% include 'order/so_tabs.html' with tab='builds' %}
|
||||
|
||||
<h4>{% trans "Build Orders" %}</h4>
|
||||
<hr>
|
||||
|
||||
<table class='table table-striped table-condensed' id='builds-table'></table>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js_ready %}
|
||||
|
||||
{{ block.super }}
|
||||
|
||||
loadBuildTable($("#builds-table"), {
|
||||
url: "{% url 'api-build-list' %}",
|
||||
params: {
|
||||
sales_order: {{ order.id }},
|
||||
part_detail: true,
|
||||
},
|
||||
});
|
||||
|
||||
{% endblock %}
|
@ -2,7 +2,15 @@
|
||||
|
||||
<ul class='nav nav-tabs'>
|
||||
<li{% ifequal tab 'details' %} class='active'{% endifequal %}>
|
||||
<a href="{% url 'so-detail' order.id %}">{% trans "Items" %}</a>
|
||||
<a href="{% url 'so-detail' order.id %}">{% trans "Order Items" %}</a>
|
||||
</li>
|
||||
<li{% if tab == 'builds' %} class='active'{% endif %}>
|
||||
<a href="{% url 'so-builds' order.id %}">
|
||||
{% trans "Build Orders" %}
|
||||
{% if order.builds.count > 0 %}
|
||||
<span class='badge'>{{ order.builds.count }}</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
<li{% if tab == 'attachments' %} class='active'{% endif %}>
|
||||
<a href="{% url 'so-attachments' order.id %}">{% trans "Attachments" %}
|
||||
|
@ -58,6 +58,7 @@ sales_order_detail_urls = [
|
||||
url(r'^cancel/', views.SalesOrderCancel.as_view(), name='so-cancel'),
|
||||
url(r'^ship/', views.SalesOrderShip.as_view(), name='so-ship'),
|
||||
|
||||
url(r'^builds/', views.SalesOrderDetail.as_view(template_name='order/so_builds.html'), name='so-builds'),
|
||||
url(r'^attachments/', views.SalesOrderDetail.as_view(template_name='order/so_attachments.html'), name='so-attachments'),
|
||||
url(r'^notes/', views.SalesOrderNotes.as_view(), name='so-notes'),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user