mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	change templates to new way
This commit is contained in:
		@@ -16,13 +16,16 @@ logger = logging.getLogger("inventree")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def notify_low_stock(part: part.models.Part):
 | 
			
		||||
    name = _("Low stock notification")
 | 
			
		||||
    message = _(f'The available stock for {part.name} has fallen below the configured minimum level')
 | 
			
		||||
    context = {
 | 
			
		||||
        # Pass the "Part" object through to the template context
 | 
			
		||||
        'part': part,
 | 
			
		||||
        'name': name,
 | 
			
		||||
        'message': message,
 | 
			
		||||
        'link': InvenTree.helpers.construct_absolute_url(part.get_absolute_url()),
 | 
			
		||||
        'template': {
 | 
			
		||||
            'html': 'email/low_stock_notification.html',
 | 
			
		||||
            'subject': "[InvenTree] " + _("Low stock notification"),
 | 
			
		||||
            'subject': "[InvenTree] " + name,
 | 
			
		||||
        },
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
{% load inventree_extras %}
 | 
			
		||||
 | 
			
		||||
{% block title %}
 | 
			
		||||
{% blocktrans with part=part.name %} The available stock for {{ part }} has fallen below the configured minimum level{% endblocktrans %}
 | 
			
		||||
{{ message }}
 | 
			
		||||
{% if link %}
 | 
			
		||||
<p>{% trans "Click on the following link to view this part" %}: <a href="{{ link }}">{{ link }}</a></p>
 | 
			
		||||
{% endif %}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user