Table filters

This commit is contained in:
Oliver 2021-11-26 22:31:25 +11:00
parent 760c80dbb6
commit d5e7489623
2 changed files with 22 additions and 3 deletions

View File

@ -61,6 +61,9 @@
<div class='panel-content'>
{% if roles.sales_order.change %}
<div id='pending-shipment-toolbar' class='btn-group' style='float: right;'>
<div class='btn-group' role='group'>
{% include "filter_list.html" with id="pending-shipments" %}
</div>
</div>
{% endif %}
<table class='table table-striped table-condensed' id='pending-shipments-table' data-toolbar='#pending-shipment-toolbar'></table>
@ -74,6 +77,9 @@
</div>
<div class='panel-content'>
<div id='completed-shipment-toolbar' class='btn-group' style='float: right;'>
<div class='btn-group' role='group'>
{% include "filter_list.html" with id="completed-shipments" %}
</div>
</div>
<table class='table table-striped table-condensed' id='completed-shipments-table' data-toolbar='#completed-shipment-toolbar'></table>
</div>
@ -84,7 +90,12 @@
<h4>{% trans "Build Orders" %}</h4>
</div>
<div class='panel-content'>
<table class='table table-striped table-condensed' id='builds-table'></table>
<div id='builds-toolbar' class='btn-group' style='float: right;'>
<div class='btn-group' role='group'>
{% include "filter_list.html" with id='build' %}
</div>
</div>
<table class='table table-striped table-condensed' id='builds-table' data-toolbar='#builds-toolbar'></table>
</div>
</div>
@ -138,6 +149,7 @@
loadSalesOrderShipmentTable('#pending-shipments-table', {
order: {{ order.pk }},
shipped: false,
filter_target: '#filter-list-pending-shipments',
});
$('#new-shipment').click(function() {
@ -151,11 +163,14 @@
{% endif %}
});
onPanelLoad('order-shipments-complete', function() {
loadSalesOrderShipmentTable('#completed-shipments-table', {
order: {{ order.pk }},
shipped: true,
filter_target: '#filter-list-completed-shipments',
});
});
$('#edit-notes').click(function() {

View File

@ -1156,7 +1156,7 @@ function loadSalesOrderShipmentTable(table, options={}) {
filters[key] = options.params[key];
}
var todo = "Setup filter list for this table";
setupFilterList('salesordershipment', $(table), options.filter_target);
function makeShipmentActions(row) {
// Construct "actions" for the given shipment row
@ -1733,6 +1733,10 @@ function showAllocationSubTable(index, row, element, options) {
data: row.allocations,
showHeader: false,
columns: [
{
field: 'part',
title: '{% trans "Part" %}',
},
{
field: 'allocated',
title: '{% trans "Quantity" %}',