2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

after_save_stock_item (#8546) (#8548)

This pull request addresses the issue discussed in #8452

(cherry picked from commit ee9980e481382133efe3a79ff6c3e38c7f6e9f02)

Co-authored-by: Volker <skydiablo@gmx.net>
This commit is contained in:
github-actions[bot] 2024-11-25 22:04:12 +11:00 committed by GitHub
parent 884851733a
commit a4894d9f4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2321,7 +2321,7 @@ def after_save_stock_item(sender, instance: StockItem, created, **kwargs):
"""Hook function to be executed after StockItem object is saved/updated.""" """Hook function to be executed after StockItem object is saved/updated."""
from part import tasks as part_tasks from part import tasks as part_tasks
if created and not InvenTree.ready.isImportingData(): if not InvenTree.ready.isImportingData():
if InvenTree.ready.canAppAccessDatabase(allow_test=True): if InvenTree.ready.canAppAccessDatabase(allow_test=True):
InvenTree.tasks.offload_task( InvenTree.tasks.offload_task(
part_tasks.notify_low_stock_if_required, instance.part part_tasks.notify_low_stock_if_required, instance.part