mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	* Exclude "tags" fields from data import
- May reintroduce at a later date
- Currently, no support for editing tags in frontend
* Refactor
(cherry picked from commit 2575c7276c)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
			
			
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							7140ea8f43
						
					
				
				
					commit
					ee06e466ca
				
			| @@ -5,6 +5,7 @@ from django.utils.translation import gettext_lazy as _ | |||||||
|  |  | ||||||
| import tablib | import tablib | ||||||
| from rest_framework import fields, serializers | from rest_framework import fields, serializers | ||||||
|  | from taggit.serializers import TagListSerializerField | ||||||
|  |  | ||||||
| import importer.operations | import importer.operations | ||||||
| from InvenTree.helpers import DownloadFile, GetExportFormats, current_date | from InvenTree.helpers import DownloadFile, GetExportFormats, current_date | ||||||
| @@ -81,6 +82,11 @@ class DataImportSerializerMixin: | |||||||
|             if issubclass(field.__class__, fields.FileField): |             if issubclass(field.__class__, fields.FileField): | ||||||
|                 continue |                 continue | ||||||
|  |  | ||||||
|  |             # Skip tags fields | ||||||
|  |             # TODO: Implement tag field support | ||||||
|  |             if issubclass(field.__class__, TagListSerializerField): | ||||||
|  |                 continue | ||||||
|  |  | ||||||
|             importable_fields[name] = field |             importable_fields[name] = field | ||||||
|  |  | ||||||
|         return importable_fields |         return importable_fields | ||||||
|   | |||||||
| @@ -344,7 +344,7 @@ class StockItemSerializer( | |||||||
|  |  | ||||||
|     export_only_fields = ['part_pricing_min', 'part_pricing_max'] |     export_only_fields = ['part_pricing_min', 'part_pricing_max'] | ||||||
|  |  | ||||||
|     import_exclude_fields = ['use_pack_size', 'tags'] |     import_exclude_fields = ['use_pack_size'] | ||||||
|  |  | ||||||
|     class Meta: |     class Meta: | ||||||
|         """Metaclass options.""" |         """Metaclass options.""" | ||||||
| @@ -1142,7 +1142,7 @@ class LocationSerializer( | |||||||
| ): | ): | ||||||
|     """Detailed information about a stock location.""" |     """Detailed information about a stock location.""" | ||||||
|  |  | ||||||
|     import_exclude_fields = ['tags'] |     import_exclude_fields = [] | ||||||
|  |  | ||||||
|     class Meta: |     class Meta: | ||||||
|         """Metaclass options.""" |         """Metaclass options.""" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user