mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-02 03:30:54 +00:00
Switch to registry for tasks (#3790)
* Add general registering functions Fixes #3787 * switch over to new method * move to static type * fix unclear naming
This commit is contained in:
@ -6,12 +6,13 @@ from django.utils.translation import gettext_lazy as _
|
||||
|
||||
import common.notifications
|
||||
import InvenTree.helpers
|
||||
import InvenTree.tasks
|
||||
import order.models
|
||||
from InvenTree.status_codes import PurchaseOrderStatus, SalesOrderStatus
|
||||
from InvenTree.tasks import ScheduledTask, scheduled_task
|
||||
from plugin.events import trigger_event
|
||||
|
||||
|
||||
@scheduled_task(ScheduledTask.DAILY)
|
||||
def notify_overdue_purchase_order(po: order.models.PurchaseOrder):
|
||||
"""Notify users that a PurchaseOrder has just become 'overdue'"""
|
||||
|
||||
@ -55,6 +56,7 @@ def notify_overdue_purchase_order(po: order.models.PurchaseOrder):
|
||||
)
|
||||
|
||||
|
||||
@scheduled_task(ScheduledTask.DAILY)
|
||||
def check_overdue_purchase_orders():
|
||||
"""Check if any outstanding PurchaseOrders have just become overdue:
|
||||
|
||||
|
Reference in New Issue
Block a user