#8037: Add role field to InventoryItem

This commit is contained in:
jeremystretch
2021-12-27 10:45:33 -05:00
parent 04fb5e544d
commit 6e9afccfd7
16 changed files with 141 additions and 65 deletions

View File

@@ -1172,7 +1172,7 @@ class DeviceBayBulkEditForm(
class InventoryItemBulkEditForm(
form_from_model(InventoryItem, ['label', 'manufacturer', 'part_id', 'description']),
form_from_model(InventoryItem, ['label', 'role', 'manufacturer', 'part_id', 'description']),
AddRemoveTagsForm,
CustomFieldModelBulkEditForm
):
@@ -1180,13 +1180,17 @@ class InventoryItemBulkEditForm(
queryset=InventoryItem.objects.all(),
widget=forms.MultipleHiddenInput()
)
role = DynamicModelChoiceField(
queryset=InventoryItemRole.objects.all(),
required=False
)
manufacturer = DynamicModelChoiceField(
queryset=Manufacturer.objects.all(),
required=False
)
class Meta:
nullable_fields = ['label', 'manufacturer', 'part_id', 'description']
nullable_fields = ['label', 'role', 'manufacturer', 'part_id', 'description']
#