2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Add "enabled" field to Label class

- Only list labels which are enabled
- Allows labels to be hidden / disabled without being deleted
This commit is contained in:
Oliver Walters
2020-08-23 09:07:15 +10:00
parent de86418ede
commit 8f1af0f5f9
4 changed files with 27 additions and 2 deletions

View File

@ -310,7 +310,8 @@ class StockItemSelectLabels(AjaxView):
labels = []
for label in StockItemLabel.objects.all():
# Construct a list of StockItemLabel objects which are enabled, and the filters match the selected StockItem
for label in StockItemLabel.objects.filter(enabled=True):
if label.matches_stock_item(item):
labels.append(label)