[PR #16955] [CLOSED] Closes #16905: Allow filtering of Inventory Items by Device Status #14958

Closed
opened 2025-12-30 00:19:08 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/16955
Author: @dannywade
Created: 7/22/2024
Status: Closed

Base: developHead: 16905-inv-item-filtering


📝 Commits (1)

  • 83ff80e Closes #16905: Added filter and field to existing filtersets

📊 Changes

2 files changed (+11 additions, -0 deletions)

View changed files

📝 netbox/dcim/filtersets.py (+6 -0)
📝 netbox/dcim/forms/filtersets.py (+5 -0)

📄 Description

Closes: #16905

Added ability to filter inventory items by the device status field.

There's currently one issue where filtering by a device status that isn't assigned to a device returns all the inventory items. The same behavior occurs when selecting an unused device status with other assigned status'. I'm still trying to figure out the issue, but do you have any ideas? I've attached the SQL debugs which show the device status queries are working, but it appears the results are not being built when filtering by an unassigned device status. Any help or tips are appreciated!
device_status_filtering_broken
device_status_filtering_working


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/16955 **Author:** [@dannywade](https://github.com/dannywade) **Created:** 7/22/2024 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `16905-inv-item-filtering` --- ### 📝 Commits (1) - [`83ff80e`](https://github.com/netbox-community/netbox/commit/83ff80e902ab580b1c8c2c30749fa52205cc3385) Closes #16905: Added filter and field to existing filtersets ### 📊 Changes **2 files changed** (+11 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/filtersets.py` (+6 -0) 📝 `netbox/dcim/forms/filtersets.py` (+5 -0) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Closes: #16905 Added ability to filter inventory items by the device status field. There's currently one issue where filtering by a device status that isn't assigned to a device returns all the inventory items. The same behavior occurs when selecting an unused device status with other assigned status'. I'm still trying to figure out the issue, but do you have any ideas? I've attached the SQL debugs which show the device status queries are working, but it appears the results are not being built when filtering by an unassigned device status. Any help or tips are appreciated! <img width="1164" alt="device_status_filtering_broken" src="https://github.com/user-attachments/assets/8a9ffe18-278e-4b0d-a861-8b87ea78682f"> <img width="1169" alt="device_status_filtering_working" src="https://github.com/user-attachments/assets/9692e549-d7aa-4ddd-999f-5230ab3ddac0"> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:19:08 +01:00
adam closed this issue 2025-12-30 00:19:08 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14958