[PR #11256] [MERGED] Fixes #11156 - Allow InventoryItem component reassignment #13761

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/11256
Author: @kkthxbye-code
Created: 12/20/2022
Status: Merged
Merged: 1/3/2023
Merged by: @jeremystretch

Base: developHead: 11156-allow-iitem-component-reassign


📝 Commits (5)

  • 93eecfc Allow re-assigning InventoryItem components
  • 9cac9f1 Refactor logic for finding initial component assignment on InventoryItems
  • cd52de6 PEP8 fix
  • e531090 Fix wrong HTML causing tab list to extend past the end of the parent row
  • c2c6dac Tweak form field labels

📊 Changes

4 files changed (+212 additions, -23 deletions)

View changed files

📝 netbox/dcim/forms/model_forms.py (+99 -12)
📝 netbox/dcim/models/device_components.py (+5 -0)
📝 netbox/dcim/views.py (+2 -11)
netbox/templates/dcim/inventoryitem_edit.html (+106 -0)

📄 Description

Fixes: #11156

This is a draft for adding component selection to the InventoryItem form. The approach here is the same as interface assignment for the IPAddress form. While I still think we should probably find a better way of doing generic relationship assignment, I believe that the feature is important enough to forgo that for now. We can easily refactor this if we find a better way in the future.

image

@jeremystretch - let me know what you think. If you agree on the approach I'll ready the PR for review.


🔄 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/11256 **Author:** [@kkthxbye-code](https://github.com/kkthxbye-code) **Created:** 12/20/2022 **Status:** ✅ Merged **Merged:** 1/3/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `11156-allow-iitem-component-reassign` --- ### 📝 Commits (5) - [`93eecfc`](https://github.com/netbox-community/netbox/commit/93eecfcd80cb60c017d75dcf0b607c1df8e6ef0c) Allow re-assigning InventoryItem components - [`9cac9f1`](https://github.com/netbox-community/netbox/commit/9cac9f10e383c8e33ada5d7962fd1d4947bc50b4) Refactor logic for finding initial component assignment on InventoryItems - [`cd52de6`](https://github.com/netbox-community/netbox/commit/cd52de6b5fc21f779b6eee94cb610ca4a6e30ff1) PEP8 fix - [`e531090`](https://github.com/netbox-community/netbox/commit/e531090200833e5fc1ac073175b0be0cff171eee) Fix wrong HTML causing tab list to extend past the end of the parent row - [`c2c6dac`](https://github.com/netbox-community/netbox/commit/c2c6daca6ee5b71771f605291462d3d3ea99e1ba) Tweak form field labels ### 📊 Changes **4 files changed** (+212 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/forms/model_forms.py` (+99 -12) 📝 `netbox/dcim/models/device_components.py` (+5 -0) 📝 `netbox/dcim/views.py` (+2 -11) ➕ `netbox/templates/dcim/inventoryitem_edit.html` (+106 -0) </details> ### 📄 Description ### Fixes: #11156 This is a draft for adding component selection to the InventoryItem form. The approach here is the same as interface assignment for the IPAddress form. While I still think we should probably find a better way of doing generic relationship assignment, I believe that the feature is important enough to forgo that for now. We can easily refactor this if we find a better way in the future. ![image](https://user-images.githubusercontent.com/400797/208650912-f2f44556-64d9-4d5a-8dee-683cf9b63095.png) @jeremystretch - let me know what you think. If you agree on the approach I'll ready the PR for review. --- <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:39 +01:00
adam closed this issue 2025-12-29 23:20:39 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13761