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 (#3259)
This commit is contained in:
InvenTree
@@ -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):
|
||||
|
Reference in New Issue
Block a user