Просмотр исходного кода

feat(ipam): Add parent object fields for Services

Include `parent_object_type` and `parent_object_id` in `clone_fields`
for services. This improves cloning behavior for models using parent
object references, ensuring more accurate data duplication.

Fixes #21168
Martin Hauser 1 неделя назад
Родитель
Сommit
be5bd74d4e
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      netbox/ipam/models/services.py

+ 3 - 1
netbox/ipam/models/services.py

@@ -87,7 +87,9 @@ class Service(ContactsMixin, ServiceBase, PrimaryModel):
         help_text=_("The specific IP addresses (if any) to which this application service is bound")
     )
 
-    clone_fields = ['protocol', 'ports', 'description', 'parent', 'ipaddresses', ]
+    clone_fields = (
+        'protocol', 'ports', 'description', 'parent_object_type', 'parent_object_id', 'ipaddresses',
+    )
 
     class Meta:
         indexes = (