mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +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:
parent
95874d9097
commit
2575c7276c
@ -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
|
||||||
|
@ -683,7 +683,7 @@ class PartSerializer(
|
|||||||
Used when displaying all details of a single component.
|
Used when displaying all details of a single component.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import_exclude_fields = ['duplicate', 'tags']
|
import_exclude_fields = ['duplicate']
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
"""Metaclass defining serializer fields."""
|
"""Metaclass defining serializer 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."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user