2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

More API fixes

- Allow searching supplier parts by manufacturer name
- Better rendering of supplier part table

(cherry picked from commit 62199aedf5)
This commit is contained in:
Oliver Walters
2020-04-13 19:33:44 +10:00
parent f88d03db88
commit 7c892263f8
4 changed files with 39 additions and 34 deletions

View File

@ -140,36 +140,18 @@ InvenTree | {% trans "Search Results" %}
serach: "{{ query }}",
}
});
$("#supplier-part-results-table").inventreeTable({
url: "{% url 'api-part-supplier-list' %}",
queryParams: {
search: "{{ query }}",
},
columns: [
{
field: 'supplier_name',
title: 'Supplier',
formatter: function(value, row, index, field) {
return imageHoverIcon(row.supplier_logo) + renderLink(value, '/company/' + row.supplier + '/');
}
loadSupplierPartTable(
"#supplier-part-results-table",
"{% url 'api-supplier-part-list' %}",
{
params: {
search: "{{ query }}",
part_detail: true,
supplier_detail: true,
manufacturer_detail: true
},
{
field: 'SKU',
title: 'SKU',
formatter: function(value, row, index, field) {
return renderLink(value, row.url);
}
},
{
field: 'manufacturer',
title: 'Manufacturer',
},
{
field: 'MPN',
title: 'MPN',
}
]
});
}
);
{% endblock %}