mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-06 23:38:48 +00:00
Ref: https://docs.djangoproject.com/en/dev/howto/writing-migrations/#non-atomic-migrations
24 lines
450 B
Python
24 lines
450 B
Python
# Generated by Django 2.2.9 on 2020-02-17 11:09
|
|
|
|
from django.db import migrations
|
|
from stock import models
|
|
|
|
|
|
def update_stock_item_tree(apps, schema_editor):
|
|
# Update the StockItem MPTT model
|
|
|
|
models.StockItem.objects.rebuild()
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
atomic = False
|
|
|
|
dependencies = [
|
|
('stock', '0021_auto_20200215_2232'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(update_stock_item_tree)
|
|
]
|