2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-13 10:35:40 +00:00

Created part.tasks file and moved notify_low_stock function to the same from InvenTree.tasks. The argument type is changed from StockItem to Part

Added trans to headers of table in email template of low_stock_notification.html

added is_part_low_on_stock() function to the part model to check if the part's stock has fallen below the minimum quantity

used offload_task function to run the low stock notification function asynchronously
This commit is contained in:
rocheparadox
2021-10-31 11:26:41 +05:30
parent fca15a0439
commit 40da41959b
5 changed files with 51 additions and 33 deletions

View File

@ -1988,6 +1988,9 @@ class Part(MPTTModel):
def related_count(self):
return len(self.get_related_parts())
def is_part_low_on_stock(self):
return self.total_stock <= self.minimum_stock
def attach_file(instance, filename):
""" Function for storing a file for a PartAttachment