mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 04:56:45 +00:00
Add purchase order and sales order to search results
This commit is contained in:
parent
0b15b77140
commit
558ea98fa1
@ -137,6 +137,13 @@ class POList(generics.ListCreateAPIView):
|
|||||||
'supplier',
|
'supplier',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
search_fields = [
|
||||||
|
'reference',
|
||||||
|
'supplier__name',
|
||||||
|
'supplier_reference',
|
||||||
|
'description',
|
||||||
|
]
|
||||||
|
|
||||||
ordering_fields = [
|
ordering_fields = [
|
||||||
'creation_date',
|
'creation_date',
|
||||||
'reference',
|
'reference',
|
||||||
@ -356,6 +363,18 @@ class SOList(generics.ListCreateAPIView):
|
|||||||
ordering_fields = [
|
ordering_fields = [
|
||||||
'creation_date',
|
'creation_date',
|
||||||
'reference'
|
'reference'
|
||||||
|
'customer__name',
|
||||||
|
'status',
|
||||||
|
'target_date',
|
||||||
|
'line_items',
|
||||||
|
'shipment_date',
|
||||||
|
]
|
||||||
|
|
||||||
|
search_fields = [
|
||||||
|
'customer__name',
|
||||||
|
'reference',
|
||||||
|
'description',
|
||||||
|
'customer_reference',
|
||||||
]
|
]
|
||||||
|
|
||||||
ordering = '-creation_date'
|
ordering = '-creation_date'
|
||||||
|
@ -283,6 +283,14 @@ InvenTree | {% trans "Search Results" %}
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
addItem('purchase-order', '{% trans "Purchase Orders" %}', 'fa-shopping-cart');
|
||||||
|
|
||||||
|
loadPurchaseOrderTable('#table-purchase-order', {
|
||||||
|
params: {
|
||||||
|
search: '{{ query }}',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
addItem('manufacturer', '{% trans "Manufacturers" %}', 'fa-industry');
|
addItem('manufacturer', '{% trans "Manufacturers" %}', 'fa-industry');
|
||||||
|
|
||||||
loadCompanyTable('#table-manufacturer', "{% url 'api-company-list' %}", {
|
loadCompanyTable('#table-manufacturer', "{% url 'api-company-list' %}", {
|
||||||
@ -305,6 +313,14 @@ InvenTree | {% trans "Search Results" %}
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
addItem('sales-orders', '{% trans "Sales Orders" %}', 'fa-truck');
|
||||||
|
|
||||||
|
loadSalesOrderTable('#table-sales-orders', {
|
||||||
|
params: {
|
||||||
|
search: '{{ query }}',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -124,6 +124,8 @@ function loadPurchaseOrderTable(table, options) {
|
|||||||
filters[key] = options.params[key];
|
filters[key] = options.params[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
options.url = options.url || '{% url "api-po-list" %}';
|
||||||
|
|
||||||
setupFilterList("purchaseorder", $(table));
|
setupFilterList("purchaseorder", $(table));
|
||||||
|
|
||||||
$(table).inventreeTable({
|
$(table).inventreeTable({
|
||||||
@ -218,6 +220,8 @@ function loadSalesOrderTable(table, options) {
|
|||||||
filters[key] = options.params[key];
|
filters[key] = options.params[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
options.url = options.url || '{% url "api-so-list" %}';
|
||||||
|
|
||||||
setupFilterList("salesorder", $(table));
|
setupFilterList("salesorder", $(table));
|
||||||
|
|
||||||
$(table).inventreeTable({
|
$(table).inventreeTable({
|
||||||
@ -258,6 +262,7 @@ function loadSalesOrderTable(table, options) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
sortName: 'customer__name',
|
||||||
field: 'customer_detail',
|
field: 'customer_detail',
|
||||||
title: '{% trans "Customer" %}',
|
title: '{% trans "Customer" %}',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
@ -267,10 +272,9 @@ function loadSalesOrderTable(table, options) {
|
|||||||
{
|
{
|
||||||
field: 'customer_reference',
|
field: 'customer_reference',
|
||||||
title: '{% trans "Customer Reference" %}',
|
title: '{% trans "Customer Reference" %}',
|
||||||
sotrable: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
sortable: true,
|
sortable: false,
|
||||||
field: 'description',
|
field: 'description',
|
||||||
title: '{% trans "Description" %}',
|
title: '{% trans "Description" %}',
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user