Export 'default_supplier' field

This commit is contained in:
Oliver Walters 2019-09-13 22:29:11 +10:00
parent 2bc34853e2
commit c579854e89

View File

@ -1,5 +1,5 @@
from django.contrib import admin
from import_export.admin import ImportExportModelAdmin, ImportExportActionModelAdmin
from import_export.admin import ImportExportModelAdmin
from import_export.resources import ModelResource
from import_export.fields import Field
import import_export.widgets as widgets
@ -21,6 +21,8 @@ class PartResource(ModelResource):
default_location = Field(attribute='default_location', widget=widgets.ForeignKeyWidget(StockLocation))
default_supplirt = Field(attribute='default_supplier', widget=widgets.ForeignKeyWidget(SupplierPart))
category_name = Field(attribute='category__name', readonly=True)
variant_of = Field(attribute='variant_of', widget=widgets.ForeignKeyWidget(Part))