[PR #11155] [MERGED] Fixes #10447 - Allow re-assigning inventoryitems to other devices #13748

Closed
opened 2025-12-29 23:20:34 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/11155
Author: @kkthxbye-code
Created: 12/11/2022
Status: Merged
Merged: 12/13/2022
Merged by: @jeremystretch

Base: developHead: 10447-allow-ii-reassign


📝 Commits (2)

  • aad1a0b Allow re-assigning inventoryitems to other devices
  • bd040e3 Add missing newline and change wording of InventoryItem validation

📊 Changes

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

View changed files

📝 netbox/dcim/forms/models.py (+7 -0)
📝 netbox/dcim/models/device_components.py (+17 -0)

📄 Description

Fixes: #10447

This is a suggested fix for allowing InventoryItems to be re-assigned to other devices. We had a discussion at one of the latest maintainers meetings about this, and my takeaway was that it would be fine to allow InventoryItems to move device. The alternative solution is to disallow it entirely, which requires disabling the device field for both the API and bulkedit.

There are two limitations to avoid inconsistant state:

  • Validation prevents re-assigning the device if the InventoryItem has a parent or has children.
  • When moving an InventoryItem the assigned component is removed.

An alternative to the second item would be to just deny the move, however it is currently not possible to de-couple an inventoryitem from a component (should also be fixed at some point), it seems like that would be too limiting.


🔄 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/11155 **Author:** [@kkthxbye-code](https://github.com/kkthxbye-code) **Created:** 12/11/2022 **Status:** ✅ Merged **Merged:** 12/13/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `10447-allow-ii-reassign` --- ### 📝 Commits (2) - [`aad1a0b`](https://github.com/netbox-community/netbox/commit/aad1a0b8879b185b4b2a750ed4fda05501598b77) Allow re-assigning inventoryitems to other devices - [`bd040e3`](https://github.com/netbox-community/netbox/commit/bd040e35504bbcee7bb5d11eaa0d93ac442925c7) Add missing newline and change wording of InventoryItem validation ### 📊 Changes **2 files changed** (+24 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/forms/models.py` (+7 -0) 📝 `netbox/dcim/models/device_components.py` (+17 -0) </details> ### 📄 Description ### Fixes: #10447 This is a suggested fix for allowing InventoryItems to be re-assigned to other devices. We had a discussion at one of the latest maintainers meetings about this, and my takeaway was that it would be fine to allow InventoryItems to move device. The alternative solution is to disallow it entirely, which requires disabling the device field for both the API and bulkedit. There are two limitations to avoid inconsistant state: * Validation prevents re-assigning the device if the InventoryItem has a parent or has children. * When moving an InventoryItem the assigned component is removed. An alternative to the second item would be to just deny the move, however it is currently not possible to de-couple an inventoryitem from a component (should also be fixed at some point), it seems like that would be too limiting. --- <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-29 23:20:34 +01:00
adam closed this issue 2025-12-29 23:20:34 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13748