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:
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user