From 240ff59b3010afe17370ac450aa1be757574a360 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 22 May 2021 20:56:56 +1000 Subject: [PATCH] Bump API version to 3 - New stock item history tracking is incompatible - Adds API info to the "about" dialog --- InvenTree/InvenTree/version.py | 11 +++++++++-- InvenTree/part/templatetags/inventree_extras.py | 6 ++++++ InvenTree/templates/about.html | 5 +++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/InvenTree/InvenTree/version.py b/InvenTree/InvenTree/version.py index 361fec152a..67962c7859 100644 --- a/InvenTree/InvenTree/version.py +++ b/InvenTree/InvenTree/version.py @@ -10,8 +10,15 @@ import common.models INVENTREE_SW_VERSION = "0.2.2 pre" -# Increment this number whenever there is a significant change to the API that any clients need to know about -INVENTREE_API_VERSION = 2 +""" +Increment thi API version number whenever there is a significant change to the API that any clients need to know about + +v3 -> 2021-05-22: + - The updated StockItem "history tracking" now uses a different interface + +""" + +INVENTREE_API_VERSION = 3 def inventreeInstanceName(): diff --git a/InvenTree/part/templatetags/inventree_extras.py b/InvenTree/part/templatetags/inventree_extras.py index 734b365447..ceb2d11e31 100644 --- a/InvenTree/part/templatetags/inventree_extras.py +++ b/InvenTree/part/templatetags/inventree_extras.py @@ -119,6 +119,12 @@ def inventree_version(*args, **kwargs): return version.inventreeVersion() +@register.simple_tag() +def inventree_api_version(*args, **kwargs): + """ Return InvenTree API version """ + return version.inventreeApiVersion() + + @register.simple_tag() def django_version(*args, **kwargs): """ Return Django version string """ diff --git a/InvenTree/templates/about.html b/InvenTree/templates/about.html index f190ab2755..7b023295d1 100644 --- a/InvenTree/templates/about.html +++ b/InvenTree/templates/about.html @@ -29,6 +29,11 @@ {% endif %} + + + {% trans "API Version" %} + {% inventree_api_version %}{% include "clip.html" %} + {% trans "Django Version" %}