1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

#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

@ -772,6 +772,11 @@ class InventoryItemCSVForm(CustomFieldModelCSVForm):
queryset=Device.objects.all(),
to_field_name='name'
)
role = CSVModelChoiceField(
queryset=InventoryItemRole.objects.all(),
to_field_name='name',
required=False
)
manufacturer = CSVModelChoiceField(
queryset=Manufacturer.objects.all(),
to_field_name='name',
@ -787,7 +792,8 @@ class InventoryItemCSVForm(CustomFieldModelCSVForm):
class Meta:
model = InventoryItem
fields = (
'device', 'name', 'label', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'discovered', 'description',
'device', 'name', 'label', 'role', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'discovered',
'description',
)
def __init__(self, *args, **kwargs):