mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-03 14:18:16 -06:00
16783 review changes
This commit is contained in:
parent
8502d179f3
commit
84d0d0bd78
@ -350,8 +350,8 @@ class InventoryItemSerializer(NetBoxModelSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = InventoryItem
|
model = InventoryItem
|
||||||
fields = [
|
fields = [
|
||||||
'id', 'url', 'display_url', 'display', 'device', 'parent', 'name', 'label', 'role', 'manufacturer',
|
'id', 'url', 'display_url', 'display', 'device', 'parent', 'name', 'label', 'status', 'role', 'manufacturer',
|
||||||
'part_id', 'serial', 'asset_tag', 'discovered', 'description', 'component_type', 'component_id', 'status',
|
'part_id', 'serial', 'asset_tag', 'discovered', 'description', 'component_type', 'component_id',
|
||||||
'component', 'tags', 'custom_fields', 'created', 'last_updated', '_depth',
|
'component', 'tags', 'custom_fields', 'created', 'last_updated', '_depth',
|
||||||
]
|
]
|
||||||
brief_fields = ('id', 'url', 'display', 'device', 'name', 'description', '_depth')
|
brief_fields = ('id', 'url', 'display', 'device', 'name', 'description', '_depth')
|
||||||
|
@ -1112,8 +1112,8 @@ class InventoryItemImportForm(NetBoxModelImportForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = InventoryItem
|
model = InventoryItem
|
||||||
fields = (
|
fields = (
|
||||||
'device', 'name', 'label', 'role', 'manufacturer', 'parent', 'part_id', 'serial', 'asset_tag', 'discovered',
|
'device', 'name', 'label', 'status', 'role', 'manufacturer', 'parent', 'part_id', 'serial', 'asset_tag', 'discovered',
|
||||||
'status', 'description', 'tags', 'component_type', 'component_name',
|
'description', 'tags', 'component_type', 'component_name',
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
@ -1576,8 +1576,8 @@ class InventoryItemForm(DeviceComponentForm):
|
|||||||
)
|
)
|
||||||
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('device', 'parent', 'name', 'label', 'role', 'description', 'tags', name=_('Inventory Item')),
|
FieldSet('device', 'parent', 'name', 'label', 'status', 'role', 'description', 'tags', name=_('Inventory Item')),
|
||||||
FieldSet('manufacturer', 'part_id', 'serial', 'asset_tag', 'status', name=_('Hardware')),
|
FieldSet('manufacturer', 'part_id', 'serial', 'asset_tag', name=_('Hardware')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
TabbedGroups(
|
TabbedGroups(
|
||||||
FieldSet('interface', name=_('Interface')),
|
FieldSet('interface', name=_('Interface')),
|
||||||
|
@ -1244,6 +1244,12 @@ class InventoryItem(MPTTModel, ComponentModel, TrackingModelMixin):
|
|||||||
ct_field='component_type',
|
ct_field='component_type',
|
||||||
fk_field='component_id'
|
fk_field='component_id'
|
||||||
)
|
)
|
||||||
|
status = models.CharField(
|
||||||
|
verbose_name=_('status'),
|
||||||
|
max_length=50,
|
||||||
|
choices=InventoryItemStatusChoices,
|
||||||
|
default=InventoryItemStatusChoices.STATUS_ACTIVE
|
||||||
|
)
|
||||||
role = models.ForeignKey(
|
role = models.ForeignKey(
|
||||||
to='dcim.InventoryItemRole',
|
to='dcim.InventoryItemRole',
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
@ -1282,16 +1288,10 @@ class InventoryItem(MPTTModel, ComponentModel, TrackingModelMixin):
|
|||||||
default=False,
|
default=False,
|
||||||
help_text=_('This item was automatically discovered')
|
help_text=_('This item was automatically discovered')
|
||||||
)
|
)
|
||||||
status = models.CharField(
|
|
||||||
verbose_name=_('status'),
|
|
||||||
max_length=50,
|
|
||||||
choices=InventoryItemStatusChoices,
|
|
||||||
default=InventoryItemStatusChoices.STATUS_ACTIVE
|
|
||||||
)
|
|
||||||
|
|
||||||
objects = TreeManager()
|
objects = TreeManager()
|
||||||
|
|
||||||
clone_fields = ('device', 'parent', 'role', 'manufacturer', 'part_id', 'status')
|
clone_fields = ('device', 'parent', 'role', 'manufacturer', 'status', 'part_id')
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('device__id', 'parent__id', '_name')
|
ordering = ('device__id', 'parent__id', '_name')
|
||||||
|
@ -961,11 +961,11 @@ class InventoryItemTable(DeviceComponentTable):
|
|||||||
class Meta(NetBoxTable.Meta):
|
class Meta(NetBoxTable.Meta):
|
||||||
model = models.InventoryItem
|
model = models.InventoryItem
|
||||||
fields = (
|
fields = (
|
||||||
'pk', 'id', 'name', 'device', 'parent', 'component', 'label', 'role', 'manufacturer', 'part_id', 'serial',
|
'pk', 'id', 'name', 'device', 'parent', 'component', 'label', 'status', 'role', 'manufacturer', 'part_id', 'serial',
|
||||||
'asset_tag', 'status', 'description', 'discovered', 'tags', 'created', 'last_updated',
|
'asset_tag', 'description', 'discovered', 'tags', 'created', 'last_updated',
|
||||||
)
|
)
|
||||||
default_columns = (
|
default_columns = (
|
||||||
'pk', 'name', 'device', 'label', 'role', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'status',
|
'pk', 'name', 'device', 'label', 'status', 'role', 'manufacturer', 'part_id', 'serial', 'asset_tag',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -981,11 +981,11 @@ class DeviceInventoryItemTable(InventoryItemTable):
|
|||||||
class Meta(NetBoxTable.Meta):
|
class Meta(NetBoxTable.Meta):
|
||||||
model = models.InventoryItem
|
model = models.InventoryItem
|
||||||
fields = (
|
fields = (
|
||||||
'pk', 'id', 'name', 'label', 'role', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'component',
|
'pk', 'id', 'name', 'label', 'status', 'role', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'component',
|
||||||
'description', 'discovered', 'tags', 'actions',
|
'description', 'discovered', 'tags', 'actions',
|
||||||
)
|
)
|
||||||
default_columns = (
|
default_columns = (
|
||||||
'pk', 'name', 'label', 'role', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'component',
|
'pk', 'name', 'label', 'status', 'role', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'component',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user