InventoryItem filters - Device Roles are mapped to InventoryItem Roles #8735

Closed
opened 2025-12-29 20:40:35 +01:00 by adam · 1 comment
Owner

Originally created by @Kani999 on GitHub (Oct 10, 2023).

Originally assigned to: @arthanson on GitHub.

NetBox version

v3.6.3

Python version

3.10

Steps to Reproduce

  1. Go to Inventory Item list view (netbo-url/dcim/inventory-items/)
  2. Click on Filters
  3. Scroll to Device filter option
  4. Select Device Role
    • Inventory Item roles are displayed instead of Device roles

image

The InventoryItem role can also be selected in the top of the filters in section Attributes

Expected Behavior

Filtering Device roles at the Device section of filters

Observed Behavior

Filtering InventoryItem roles at the Device section of filters

Originally created by @Kani999 on GitHub (Oct 10, 2023). Originally assigned to: @arthanson on GitHub. ### NetBox version v3.6.3 ### Python version 3.10 ### Steps to Reproduce 1. Go to Inventory Item list view (netbo-url/dcim/inventory-items/) 2. Click on Filters 3. Scroll to `Device` filter option 4. Select Device Role - `Inventory Item` **roles** are displayed instead of `Device` **roles** ![image](https://github.com/netbox-community/netbox/assets/17337078/14abb399-aee5-417d-9722-4b3fc2e4c74c) The InventoryItem role can also be selected in the top of the filters in section **Attributes** ### Expected Behavior Filtering Device roles at the `Device` section of filters ### Observed Behavior Filtering InventoryItem roles at the `Device` section of filters
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 20:40:35 +01:00
adam closed this issue 2025-12-29 20:40:35 +01:00
Author
Owner

@Kani999 commented on GitHub (Oct 10, 2023):

I suppose 4286c1cde2/netbox/dcim/forms/filtersets.py (L1392C1-L1393C1) the fieldsets have both for Device and Attributes set the same role_id.
So it should be renamed to something like inventory_item_role_id when the role_id is defined in the DeviceComponentFilterForm

@Kani999 commented on GitHub (Oct 10, 2023): I suppose https://github.com/netbox-community/netbox/blob/4286c1cde255a9bf146b3b192e1ac17566af0094/netbox/dcim/forms/filtersets.py#L1392C1-L1393C1 the fieldsets have both for `Device` and `Attributes` set the same `role_id`. So it should be renamed to something like `inventory_item_role_id` when the `role_id` is defined in the `DeviceComponentFilterForm`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8735