2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

use direct import instead of text for offload

This commit is contained in:
Matthias Mair
2022-05-16 17:45:51 +02:00
parent 9ec626b650
commit 0f5c03e44c
8 changed files with 17 additions and 14 deletions

View File

@ -49,6 +49,7 @@ from users.models import Owner
from company import models as CompanyModels
from part import models as PartModels
from part import tasks as part_tasks
class StockLocation(InvenTreeTree):
@ -2026,7 +2027,7 @@ def after_delete_stock_item(sender, instance: StockItem, **kwargs):
if not InvenTree.ready.isImportingData():
# Run this check in the background
InvenTree.tasks.offload_task('part.tasks.notify_low_stock_if_required', instance.part)
InvenTree.tasks.offload_task(part_tasks.notify_low_stock_if_required, instance.part)
@receiver(post_save, sender=StockItem, dispatch_uid='stock_item_post_save_log')
@ -2037,7 +2038,7 @@ def after_save_stock_item(sender, instance: StockItem, created, **kwargs):
if not InvenTree.ready.isImportingData():
# Run this check in the background
InvenTree.tasks.offload_task('part.tasks.notify_low_stock_if_required', instance.part)
InvenTree.tasks.offload_task(part_tasks.notify_low_stock_if_required, instance.part)
class StockItemAttachment(InvenTreeAttachment):