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