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

Issued by filter (#5515)

* Construct dynamic user filter for issued-by

* Allow "build order" table to be filtered by "issued_by" field

* Bump API version

* Fix API version
This commit is contained in:
Oliver
2023-09-08 09:10:42 +10:00
committed by GitHub
parent 8a3477a406
commit 1e55fc8b6d
3 changed files with 30 additions and 1 deletions

View File

@ -18,6 +18,30 @@
*/
// Construct a dynamic API filter for the "issued by" field
function constructIssuedByFilter() {
return {
title: '{% trans "Issued By" %}',
options: function() {
let users = {};
inventreeGet('{% url "api-user-list" %}', {}, {
async: false,
success: function(response) {
for (let user of response) {
users[user.pk] = {
key: user.pk,
value: user.username
};
}
}
});
return users;
}
}
}
// Construct a dynamic API filter for the "project" field
function constructProjectCodeFilter() {
return {
@ -482,6 +506,7 @@ function getBuildTableFilters() {
return ownersList;
},
},
issued_by: constructIssuedByFilter(),
};
if (global_settings.PROJECT_CODES_ENABLED) {