Display available stock in part search page

This commit is contained in:
Oliver Walters 2019-04-26 21:31:53 +10:00
parent 2ff5f57f60
commit deebc80088

View File

@ -51,7 +51,18 @@
field: 'description', field: 'description',
title: 'Description', title: 'Description',
searchable: true, searchable: true,
},
{
field: 'available_stock',
title: 'Stock',
formatter: function(value, row, index, field) {
if (value) {
return renderLink(value, row.url + 'stock/');
} else {
return renderLink('No stock', row.url + 'stock/');
} }
}
},
], ],
url: "{% url 'api-part-list' %}" url: "{% url 'api-part-list' %}"
}); });