mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	Import fix (#8924)
* Exclude "tags" fields from data import - May reintroduce at a later date - Currently, no support for editing tags in frontend * Refactor
This commit is contained in:
		| @@ -5,6 +5,7 @@ from django.utils.translation import gettext_lazy as _ | ||||
|  | ||||
| import tablib | ||||
| from rest_framework import fields, serializers | ||||
| from taggit.serializers import TagListSerializerField | ||||
|  | ||||
| import importer.operations | ||||
| from InvenTree.helpers import DownloadFile, GetExportFormats, current_date | ||||
| @@ -81,6 +82,11 @@ class DataImportSerializerMixin: | ||||
|             if issubclass(field.__class__, fields.FileField): | ||||
|                 continue | ||||
|  | ||||
|             # Skip tags fields | ||||
|             # TODO: Implement tag field support | ||||
|             if issubclass(field.__class__, TagListSerializerField): | ||||
|                 continue | ||||
|  | ||||
|             importable_fields[name] = field | ||||
|  | ||||
|         return importable_fields | ||||
|   | ||||
| @@ -683,7 +683,7 @@ class PartSerializer( | ||||
|     Used when displaying all details of a single component. | ||||
|     """ | ||||
|  | ||||
|     import_exclude_fields = ['duplicate', 'tags'] | ||||
|     import_exclude_fields = ['duplicate'] | ||||
|  | ||||
|     class Meta: | ||||
|         """Metaclass defining serializer fields.""" | ||||
|   | ||||
| @@ -344,7 +344,7 @@ class StockItemSerializer( | ||||
|  | ||||
|     export_only_fields = ['part_pricing_min', 'part_pricing_max'] | ||||
|  | ||||
|     import_exclude_fields = ['use_pack_size', 'tags'] | ||||
|     import_exclude_fields = ['use_pack_size'] | ||||
|  | ||||
|     class Meta: | ||||
|         """Metaclass options.""" | ||||
| @@ -1142,7 +1142,7 @@ class LocationSerializer( | ||||
| ): | ||||
|     """Detailed information about a stock location.""" | ||||
|  | ||||
|     import_exclude_fields = ['tags'] | ||||
|     import_exclude_fields = [] | ||||
|  | ||||
|     class Meta: | ||||
|         """Metaclass options.""" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user