mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-07 10:51:17 +00:00
Manager for importing StockLocation data
This commit is contained in:
1 parent
37ab3d214d
commit
23b814569a
2 files changed
+38
-5
No files matched your search
@@ -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