diff --git a/docs/release-notes/version-3.2.md b/docs/release-notes/version-3.2.md index 7af5cf109..8419ec86d 100644 --- a/docs/release-notes/version-3.2.md +++ b/docs/release-notes/version-3.2.md @@ -155,6 +155,7 @@ Where it is desired to limit the range of available VLANs within a group, users * [#8682](https://github.com/netbox-community/netbox/issues/8682) - Limit available VLANs by group min/max VIDs * [#8683](https://github.com/netbox-community/netbox/issues/8683) - Fix `ZoneInfoNotFoundError` exception under Python 3.9+ * [#8761](https://github.com/netbox-community/netbox/issues/8761) - Correct view name resolution under journal entry views +* [#8763](https://github.com/netbox-community/netbox/issues/8763) - Fix inventory item component assignment * [#8764](https://github.com/netbox-community/netbox/issues/8764) - Correct view name resolution for dynamic form fields ### Other Changes diff --git a/netbox/dcim/tables/template_code.py b/netbox/dcim/tables/template_code.py index 89d04c35d..92739c6ed 100644 --- a/netbox/dcim/tables/template_code.py +++ b/netbox/dcim/tables/template_code.py @@ -113,7 +113,7 @@ MODULAR_COMPONENT_TEMPLATE_BUTTONS = """ CONSOLEPORT_BUTTONS = """ {% if perms.dcim.add_inventoryitem %} - + {% endif %} @@ -145,7 +145,7 @@ CONSOLEPORT_BUTTONS = """ CONSOLESERVERPORT_BUTTONS = """ {% if perms.dcim.add_inventoryitem %} - + {% endif %} @@ -177,7 +177,7 @@ CONSOLESERVERPORT_BUTTONS = """ POWERPORT_BUTTONS = """ {% if perms.dcim.add_inventoryitem %} - + {% endif %} @@ -208,7 +208,7 @@ POWERPORT_BUTTONS = """ POWEROUTLET_BUTTONS = """ {% if perms.dcim.add_inventoryitem %} - + {% endif %} @@ -236,7 +236,7 @@ POWEROUTLET_BUTTONS = """ INTERFACE_BUTTONS = """ {% if perms.ipam.add_ipaddress or perms.dcim.add_inventoryitem %} - @@ -292,7 +292,7 @@ INTERFACE_BUTTONS = """ FRONTPORT_BUTTONS = """ {% if perms.dcim.add_inventoryitem %} - + {% endif %} @@ -329,7 +329,7 @@ FRONTPORT_BUTTONS = """ REARPORT_BUTTONS = """ {% if perms.dcim.add_inventoryitem %} - + {% endif %} diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index 06dd5367f..520820566 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -1397,7 +1397,7 @@ class InventoryItemTemplateCreateView(generic.ComponentCreateView): queryset = InventoryItemTemplate.objects.all() form = forms.ModularComponentTemplateCreateForm model_form = forms.InventoryItemTemplateForm - template_name = 'dcim/inventoryitem_create.html' + template_name = 'dcim/inventoryitemtemplate_create.html' def alter_object(self, instance, request): # Set component (if any) diff --git a/netbox/templates/dcim/component_create.html b/netbox/templates/dcim/component_create.html index a8750e20e..e078bf069 100644 --- a/netbox/templates/dcim/component_create.html +++ b/netbox/templates/dcim/component_create.html @@ -2,6 +2,8 @@ {% load form_helpers %} {% block form %} - {% render_form replication_form %} + {% block replication_fields %} + {% render_form replication_form %} + {% endblock replication_fields %} {{ block.super }} {% endblock form %} diff --git a/netbox/templates/dcim/inventoryitem_create.html b/netbox/templates/dcim/inventoryitem_create.html index 9180cf6ab..be910f143 100644 --- a/netbox/templates/dcim/inventoryitem_create.html +++ b/netbox/templates/dcim/inventoryitem_create.html @@ -1,4 +1,4 @@ -{% extends 'dcim/component_template_create.html' %} +{% extends 'dcim/component_create.html' %} {% load helpers %} {% load form_helpers %} diff --git a/netbox/templates/dcim/inventoryitemtemplate_create.html b/netbox/templates/dcim/inventoryitemtemplate_create.html new file mode 100644 index 000000000..9180cf6ab --- /dev/null +++ b/netbox/templates/dcim/inventoryitemtemplate_create.html @@ -0,0 +1,17 @@ +{% extends 'dcim/component_template_create.html' %} +{% load helpers %} +{% load form_helpers %} + +{% block replication_fields %} + {{ block.super }} + {% if object.component %} +
+ +
+ +
+
+ {% endif %} +{% endblock replication_fields %}