2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 19:50:59 +00:00

Notify users when a build order is completed (#3255)

This commit is contained in:
Oliver
2022-06-26 09:25:37 +10:00
committed by GitHub
parent 56bbda60b5
commit b2e31e3474
3 changed files with 72 additions and 3 deletions

View File

@ -291,7 +291,7 @@ class InvenTreeNotificationBodies:
NewOrder = NotificationBody(
name=_("New {verbose_name}"),
slug='{app_label}.new_{model_name}',
message=_("A new {verbose_name} has been created and ,assigned to you"),
message=_("A new order has been created and assigned to you"),
template='email/new_order_assigned.html',
)
"""Send when a new order (build, sale or purchase) was created."""
@ -344,8 +344,10 @@ def trigger_notification(obj, category=None, obj_ref='pk', **kwargs):
if targets:
for target in targets:
if target is None:
continue
# User instance is provided
if isinstance(target, get_user_model()):
elif isinstance(target, get_user_model()):
if target not in target_exclude:
target_users.add(target)
# Group instance is provided