diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index f37b61864d..23aea29dbd 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -2098,7 +2098,7 @@ class Part(MPTTModel): Returns True if the total stock for this part is less than the minimum stock level """ - return self.total_stock <= self.minimum_stock + return self.get_stock_count() < self.minimum_stock @receiver(post_save, sender=Part, dispatch_uid='part_post_save_log') diff --git a/InvenTree/templates/email/low_stock_notification.html b/InvenTree/templates/email/low_stock_notification.html index 4db9c2ddaa..f922187f33 100644 --- a/InvenTree/templates/email/low_stock_notification.html +++ b/InvenTree/templates/email/low_stock_notification.html @@ -8,15 +8,12 @@ {% if link %}

{% trans "Click on the following link to view this part" %}: {{ link }}

{% endif %} -{% endblock %} +{% endblock title %} -{% block subtitle %} -

{% blocktrans with part=part.name %}You are receiving this email because you are subscribed to notifications for this part {% endblocktrans %}.

-{% endblock %} {% block body %} - {% trans "Part Name" %} + {% trans "Part" %} {% trans "Total Stock" %} {% trans "Available" %} {% trans "Minimum Quantity" %} @@ -24,8 +21,12 @@ {{ part.full_name }} - {{ part.total_stock }} - {{ part.available_stock }} - {{ part.minimum_stock }} + {% decimal part.total_stock %} + {% decimal part.available_stock %} + {% decimal part.minimum_stock %} -{% endblock %} +{% endblock body %} + +{% block footer_prefix %} +

{% blocktrans with part=part.name %}You are receiving this email because you are subscribed to notifications for this part {% endblocktrans %}.

+{% endblock footer_prefix %}