Repository: netbox-community/netbox

Issue:
Ability to move inventory items between different devices
**Issue type**
[X] Feature request 
[ ] Bug report 
[ ] Documentation

**Environment**
Python version: 3.5.2
NetBox version: 2.3.5

**Description**
Create the ability to move inventory items between different devices.



Discussion:
Just wanted to request exactly that feature!
We currently have SFP transceivers being added in the "Inventory" section of the devices and are willing to be able to move them between the devices.
It's also useful to have a device registered like a "warehouse" with items like transceivers, power supplies, fan modules and so on and to have flexibility of moving these items from the "warehouse" to actual devices inventory.
This needs much more detail to be actionable. Please describe the workflow and any other changes being proposed.
For example: the server has RAID-cards and HDD / SSD.
Periodically need to move them to another server.
If the equipment needs to be deleted on the first server and created on the second server - it will not be correct for inventory and it is not possible to have a history of equipments transfer.
Would like to have possibility detach inventory object from one server/device and  attach to second.

It is one thing to allow inventory items to be transferred from one device to another (which would be something nice to have) and a completely separate thing to have a history log of all the moves.  I would see the latter as part of the upcoming change logging feature slated for 2.4.
Scenario 1:  Allow Inventory items to be entered without being assigned to a specific device, with the option to edit the assigned device.
-or-
Scenario 2: From the Inventory Items page, add an action that would allow re-assigning the item to a different device.

Since inventory items are currently stored in a separate table, I wouldn't imagine the back end would need much modification.  If an inventory item requires an assigned device, the user could create an "Inventory Storage" device to hold items that are not technically assigned to a device at the time.
My guess is the initial request is to accommodate tracking an item moving between devices, rather than deleting and re-creating the item as it moves. 
As mmahacek said, I would like to add both Scenario 1 and Scenario 2 to the Inventory Items. 

This implementation will be the catalyst in ingratiating Netbox in our datacenter.  Without a way to track the location of inventory and place it into hold or a "warehouse" status in netbox; and/or move it into another device, it has been turned down every time by our team.  
> Scenario 1: Allow Inventory items to be entered without being assigned to a specific device, with the option to edit the assigned device.

This is going to be a hard "no," as it would cross the line into the realm of general inventory management. Our stance has always been that if the item isn't installed in a device, it shouldn't exist in NetBox.

> Scenario 2: From the Inventory Items page, add an action that would allow re-assigning the item to a different device.

I'm going to mark this FR as accepted with the caveat that this is the limitation of its scope: Reassigning an existing InventoryItem from one device to another via the web UI.

Resolving patch:
diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py
--- a/netbox/dcim/forms.py
+++ b/netbox/dcim/forms.py
@@ -3285,9 +3285,12 @@ class InventoryItemForm(BootstrapMixin, forms.ModelForm):
     class Meta:
         model = InventoryItem
         fields = [
-            'name', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'description', 'tags',
+            'name', 'device', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'description', 'tags',
         ]
         widgets = {
+            'device': APISelect(
+                api_url="/api/dcim/devices/"
+            ),
             'manufacturer': APISelect(
                 api_url="/api/dcim/manufacturers/"
             )
@@ -3323,9 +3326,19 @@ class InventoryItemBulkEditForm(BootstrapMixin, BulkEditForm):
         queryset=InventoryItem.objects.all(),
         widget=forms.MultipleHiddenInput()
     )
+    device = forms.ModelChoiceField(
+        queryset=Device.objects.all(),
+        required=False,
+        widget=APISelect(
+            api_url="/api/dcim/devices/"
+        )
+    )
     manufacturer = forms.ModelChoiceField(
         queryset=Manufacturer.objects.all(),
-        required=False
+        required=False,
+        widget=APISelect(
+            api_url="/api/dcim/manufacturers/"
+        )
     )
     part_id = forms.CharField(
         max_length=50,
@@ -3356,11 +3369,14 @@ class InventoryItemFilterForm(BootstrapMixin, forms.Form):
     manufacturer = FilterChoiceField(
         queryset=Manufacturer.objects.all(),
         to_field_name='slug',
-        null_label='-- None --'
+        widget=APISelect(
+            api_url="/api/dcim/manufacturers/",
+            value_field="slug",
+        )
     )
     discovered = forms.NullBooleanField(
         required=False,
-        widget=forms.Select(
+        widget=StaticSelect2(
             choices=BOOLEAN_WITH_BLANK_CHOICES
         )
     )


Test patch: