mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-09 07:00:56 +00:00
Add custom migration
- Required to initialize the MPTT fields for the StockItem model
This commit is contained in:
@ -85,6 +85,13 @@ class StockItemResource(ModelResource):
|
||||
|
||||
stocktake_date = Field(attribute='stocktake_date', widget=widgets.DateWidget())
|
||||
|
||||
def after_import(self, dataset, result, using_transactions, dry_run, **kwargs):
|
||||
|
||||
super().after_import(dataset, result, using_transactions, dry_run, **kwargs)
|
||||
|
||||
# Rebuild the StockItem tree(s)
|
||||
StockItem.objects.rebuild()
|
||||
|
||||
class Meta:
|
||||
model = StockItem
|
||||
skip_unchanged = True
|
||||
|
Reference in New Issue
Block a user