diff --git a/InvenTree/InvenTree/helpers.py b/InvenTree/InvenTree/helpers.py index 0d8a84a5d7..6ae31d6f5f 100644 --- a/InvenTree/InvenTree/helpers.py +++ b/InvenTree/InvenTree/helpers.py @@ -69,6 +69,35 @@ def getStaticUrl(filename): return os.path.join(STATIC_URL, str(filename)) +def construct_absolute_url(*arg): + """ + Construct (or attempt to construct) an absolute URL from a relative URL. + + This is useful when (for example) sending an email to a user with a link + to something in the InvenTree web framework. + + This requires the BASE_URL configuration option to be set! + """ + + base = str(InvenTreeSetting.get_setting('INVENTREE_BASE_URL')) + + url = '/'.join(arg) + + if not base: + return url + + # Strip trailing slash from base url + if base.endswith('/'): + base = base[:-1] + + if url.startswith('/'): + url = url[1:] + + url = f"{base}/{url}" + + return url + + def getBlankImage(): """ Return the qualified path for the 'blank image' placeholder. diff --git a/InvenTree/InvenTree/static/css/inventree.css b/InvenTree/InvenTree/static/css/inventree.css index a1cabc0435..61037c9c54 100644 --- a/InvenTree/InvenTree/static/css/inventree.css +++ b/InvenTree/InvenTree/static/css/inventree.css @@ -141,6 +141,10 @@ float: left; } +.navbar-spacer { + height: 60px; +} + #navbar-barcode-li { border-left: none; border-right: none; @@ -545,7 +549,6 @@ .inventree-body { width: 100%; padding: 5px; - margin-top: 10px; } .inventree-pre-content { @@ -562,10 +565,6 @@ transition: 0.1s; } -.body { - padding-top: 50px; -} - .modal { overflow: hidden; z-index: 9999; diff --git a/InvenTree/InvenTree/tasks.py b/InvenTree/InvenTree/tasks.py index aa17ef8603..801c75aa26 100644 --- a/InvenTree/InvenTree/tasks.py +++ b/InvenTree/InvenTree/tasks.py @@ -52,7 +52,7 @@ def schedule_task(taskname, **kwargs): pass -def offload_task(taskname, force_sync=False, *args, **kwargs): +def offload_task(taskname, *args, force_sync=False, **kwargs): """ Create an AsyncTask if workers are running. This is different to a 'scheduled' task, @@ -108,7 +108,7 @@ def offload_task(taskname, force_sync=False, *args, **kwargs): return # Workers are not running: run it as synchronous task - _func() + _func(*args, **kwargs) def heartbeat(): @@ -290,7 +290,7 @@ def update_exchange_rates(): Rate.objects.filter(backend="InvenTreeExchange").exclude(currency__in=currency_codes()).delete() -def send_email(subject, body, recipients, from_email=None): +def send_email(subject, body, recipients, from_email=None, html_message=None): """ Send an email with the specified subject and body, to the specified recipients list. @@ -306,4 +306,5 @@ def send_email(subject, body, recipients, from_email=None): from_email, recipients, fail_silently=False, + html_message=html_message ) diff --git a/InvenTree/InvenTree/test_api.py b/InvenTree/InvenTree/test_api.py index dfe94c034e..6ace21b576 100644 --- a/InvenTree/InvenTree/test_api.py +++ b/InvenTree/InvenTree/test_api.py @@ -102,9 +102,9 @@ class APITests(InvenTreeAPITestCase): fixtures = [ 'location', - 'stock', - 'part', 'category', + 'part', + 'stock' ] token = None diff --git a/InvenTree/build/templates/build/detail.html b/InvenTree/build/templates/build/detail.html index 9400eb6473..d53122cdd1 100644 --- a/InvenTree/build/templates/build/detail.html +++ b/InvenTree/build/templates/build/detail.html @@ -142,7 +142,7 @@
{% blocktrans with step=wizard.steps.step1 count=wizard.steps.count %}Step {{step}} of {{count}}{% endblocktrans %} + {% if description %}- {{ description }}{% endif %}
+ + + {% endblock form_buttons_bottom %} +- | {% trans "IPN" %} | -{{ part.IPN }}{% include "clip.html"%} | -||||
{% trans "Name" %} | @@ -37,6 +30,22 @@{% trans "Description" %} | {{ part.description }}{% include "clip.html"%} | ||||
+ | {% trans "Category" %} | ++ {{ part.category }} + | +||||
+ | {% trans "IPN" %} | +{{ part.IPN }}{% include "clip.html"%} | +||||
@@ -44,6 +53,20 @@ | {{ part.revision }}{% include "clip.html"%} | |||||
+ | {% trans "Units" %} | +{{ part.units }} | +||||
+ | {% trans "Minimum stock level" %} | +{{ part.minimum_stock }} | +||||
@@ -64,7 +87,7 @@ | {{ part.creation_date }} {% if part.creation_user %} - {{ part.creation_user }} + {{ part.creation_user }} {% endif %} | |||||
{% trans "Default Location" %} | -{{ part.default_location }} | ++ {{ part.default_location }} + | {% trans "Last Stocktake" %} | {% if item.stocktake_date %} -{{ item.stocktake_date }} {{ item.stocktake_user }} | +{{ item.stocktake_date }} {{ item.stocktake_user }} | {% else %}{% trans "No stocktake performed" %} | {% endif %} diff --git a/InvenTree/stock/templates/stock/location.html b/InvenTree/stock/templates/stock/location.html index 7490d262bd..521a7bdca8 100644 --- a/InvenTree/stock/templates/stock/location.html +++ b/InvenTree/stock/templates/stock/location.html @@ -183,7 +183,8 @@ {% else %} parent: 'null', {% endif %} - } + }, + allowTreeView: true, }); linkButtonsToSelection( diff --git a/InvenTree/stock/templates/stock/location_delete.html b/InvenTree/stock/templates/stock/location_delete.html index 22b4168173..9c560e58c5 100644 --- a/InvenTree/stock/templates/stock/location_delete.html +++ b/InvenTree/stock/templates/stock/location_delete.html @@ -36,7 +36,7 @@ If this location is deleted, these items will be moved to the top level 'Stock'
{% trans "Base Currency" %} | {{ base_currency }} | |||||
---|---|---|---|---|---|---|
{% trans "Exchange Rates" %} | ++ | {% trans "Exchange Rates" %} | ||||
{{ rate.currency }} | +{{ rate.value }} | +{{ rate.currency }} | ++ | |||
{% trans "Last Update" %} | -+ |
{% if rates_updated %}
{{ rates_updated }}
{% else %}
@@ -44,7 +46,7 @@
{% csrf_token %}
-
+
|
diff --git a/InvenTree/templates/InvenTree/settings/login.html b/InvenTree/templates/InvenTree/settings/login.html
index d3cba1180f..96d986d6c7 100644
--- a/InvenTree/templates/InvenTree/settings/login.html
+++ b/InvenTree/templates/InvenTree/settings/login.html
@@ -17,7 +17,7 @@
{% include "InvenTree/settings/setting.html" with key="LOGIN_ENABLE_PWD_FORGOT" icon="fa-info-circle" %}
{% include "InvenTree/settings/setting.html" with key="LOGIN_MAIL_REQUIRED" icon="fa-info-circle" %}
||||
{% trans 'Signup' %} | +{% trans 'Signup' %} |