mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-20 05:46:34 +00:00
Manager for importing StockLocation data
This commit is contained in:
@ -52,10 +52,10 @@ class PartCategoryResource(ModelResource):
|
||||
|
||||
parent = Field(attribute='parent', widget=widgets.ForeignKeyWidget(PartCategory))
|
||||
|
||||
default_location = Field(attribute='default_location', widget=widgets.ForeignKeyWidget(StockLocation))
|
||||
|
||||
parent_name = Field(attribute='parent__name', readonly=True)
|
||||
|
||||
default_location = Field(attribute='default_location', widget=widgets.ForeignKeyWidget(StockLocation))
|
||||
|
||||
class Meta:
|
||||
model = PartCategory
|
||||
skip_unchanged = True
|
||||
@ -70,10 +70,8 @@ class PartCategoryResource(ModelResource):
|
||||
|
||||
super().after_import(dataset, result, using_transactions, dry_run, **kwargs)
|
||||
|
||||
print("Rebuilding PartCategory tree")
|
||||
# Rebuild teh PartCategory tree
|
||||
# Rebuild the PartCategory tree(s)
|
||||
PartCategory.objects.rebuild()
|
||||
print("Done!")
|
||||
|
||||
|
||||
class PartCategoryAdmin(ImportExportModelAdmin):
|
||||
|
Reference in New Issue
Block a user