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

Allow re-assigning inventoryitems to other devices

This commit is contained in:
kkthxbye-code
2022-12-11 13:53:04 +01:00
committed by Jeremy Stretch
parent 860805ba82
commit 41f631b65b
2 changed files with 24 additions and 0 deletions

View File

@@ -1610,6 +1610,13 @@ class InventoryItemForm(DeviceComponentForm):
('Hardware', ('manufacturer', 'part_id', 'serial', 'asset_tag')),
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Specifically allow editing the device of IntentoryItems
if self.instance.pk:
self.fields['device'].disabled = False
class Meta:
model = InventoryItem
fields = [