2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-31 17:11:34 +00:00

Adds notification when items are received against a purcahse order ()

This commit is contained in:
Oliver
2022-06-27 07:30:38 +10:00
committed by GitHub
parent b13e12b7bd
commit ad57ca5ddf
3 changed files with 27 additions and 0 deletions

@@ -24,6 +24,7 @@ from mptt.models import TreeForeignKey
import InvenTree.helpers
import InvenTree.ready
from common.notifications import InvenTreeNotificationBodies
from common.settings import currency_code_default
from company.models import Company, SupplierPart
from InvenTree.exceptions import log_error
@@ -560,6 +561,14 @@ class PurchaseOrder(Order):
self.received_by = user
self.complete_order() # This will save the model
# Issue a notification to interested parties, that this order has been "updated"
notify_responsible(
self,
PurchaseOrder,
exclude=user,
content=InvenTreeNotificationBodies.ItemsReceived,
)
@receiver(post_save, sender=PurchaseOrder, dispatch_uid='purchase_order_post_save')
def after_save_purchase_order(sender, instance: PurchaseOrder, created: bool, **kwargs):