Merge remote-tracking branch 'inventree/master' into drf-api-forms

This commit is contained in:
Oliver 2021-07-03 12:35:40 +10:00
commit 90a3a8a288
21 changed files with 6565 additions and 5674 deletions

View File

@ -28,7 +28,7 @@ def currency_code_mappings():
""" """
Returns the current currency choices Returns the current currency choices
""" """
return [(a, a) for a in settings.CURRENCIES] return [(a, CURRENCIES[a].name) for a in settings.CURRENCIES]
def currency_codes(): def currency_codes():

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,7 @@
part: {{ part.id }}, part: {{ part.id }},
location_detail: true, location_detail: true,
part_detail: false, part_detail: false,
supplier_part_detail: true,
}, },
groupByField: 'location', groupByField: 'location',
buttons: [ buttons: [

View File

@ -857,6 +857,17 @@ class StockList(generics.ListCreateAPIView):
print("After error:", str(updated_after)) print("After error:", str(updated_after))
pass pass
# Filter stock items which have a purchase price set
has_purchase_price = params.get('has_purchase_price', None)
if has_purchase_price is not None:
has_purchase_price = str2bool(has_purchase_price)
if has_purchase_price:
queryset = queryset.exclude(purchase_price=None)
else:
queryset = queryset.filter(purchase_price=None)
# Optionally, limit the maximum number of returned results # Optionally, limit the maximum number of returned results
max_results = params.get('max_results', None) max_results = params.get('max_results', None)

View File

@ -685,6 +685,20 @@ function loadStockTable(table, options) {
return renderLink(text, link); return renderLink(text, link);
} }
}, },
{
field: 'supplier_part',
title: '{% trans "Supplier Part" %}',
formatter: function(value, row) {
if (!value) {
return '-';
}
var link = `/supplier-part/${row.supplier_part}/stock/`;
var text = `${row.supplier_part_detail.SKU}`;
return renderLink(text, link);
}
},
{ {
field: 'purchase_price', field: 'purchase_price',
title: '{% trans "Purchase Price" %}', title: '{% trans "Purchase Price" %}',

View File

@ -205,7 +205,12 @@ function getAvailableTableFilters(tableKey) {
batch: { batch: {
title: '{% trans "Batch" %}', title: '{% trans "Batch" %}',
description: '{% trans "Batch code" %}', description: '{% trans "Batch code" %}',
} },
has_purchase_price: {
type: 'bool',
title: '{% trans "Has purchase price" %}',
description: '{% trans "Show stock items which have a purchase price set" %}',
},
}; };
} }

View File

@ -63,7 +63,7 @@
<td>{% trans "Email Settings" %}</td> <td>{% trans "Email Settings" %}</td>
<td> <td>
<a href='https://inventree.readthedocs.io/en/latest/admin/email'> <a href='https://inventree.readthedocs.io/en/latest/admin/email'>
<span class='label label-red'>{% trans "Email settings not configured" %}</span> <span class='label label-yellow'>{% trans "Email settings not configured" %}</span>
</a> </a>
</td> </td>
</tr> </tr>

View File

@ -1,4 +1,4 @@
FROM python:alpine as base FROM alpine:3.13 as base
# GitHub source # GitHub source
ARG repository="https://github.com/inventree/InvenTree.git" ARG repository="https://github.com/inventree/InvenTree.git"
@ -57,7 +57,7 @@ RUN apk add --no-cache cairo cairo-dev pango pango-dev
RUN apk add --no-cache fontconfig ttf-droid ttf-liberation ttf-dejavu ttf-opensans ttf-ubuntu-font-family font-croscore font-noto RUN apk add --no-cache fontconfig ttf-droid ttf-liberation ttf-dejavu ttf-opensans ttf-ubuntu-font-family font-croscore font-noto
# Python # Python
RUN apk add --no-cache python3 python3-dev RUN apk add --no-cache python3 python3-dev py3-pip
# SQLite support # SQLite support
RUN apk add --no-cache sqlite RUN apk add --no-cache sqlite

View File

@ -32,7 +32,7 @@ echo "Starting InvenTree server..."
# Wait for the database to be ready # Wait for the database to be ready
cd ${INVENTREE_HOME}/InvenTree cd ${INVENTREE_HOME}/InvenTree
python manage.py wait_for_db python3 manage.py wait_for_db
sleep 10 sleep 10
@ -40,10 +40,10 @@ echo "Running InvenTree database migrations..."
# We assume at this stage that the database is up and running # We assume at this stage that the database is up and running
# Ensure that the database schema are up to date # Ensure that the database schema are up to date
python manage.py check || exit 1 python3 manage.py check || exit 1
python manage.py migrate --noinput || exit 1 python3 manage.py migrate --noinput || exit 1
python manage.py migrate --run-syncdb || exit 1 python3 manage.py migrate --run-syncdb || exit 1
python manage.py clearsessions || exit 1 python3 manage.py clearsessions || exit 1
# Launch a development server # Launch a development server
python manage.py runserver ${INVENTREE_WEB_ADDR}:${INVENTREE_WEB_PORT} python3 manage.py runserver ${INVENTREE_WEB_ADDR}:${INVENTREE_WEB_PORT}

View File

@ -11,9 +11,9 @@ sleep 5
# Wait for the database to be ready # Wait for the database to be ready
cd InvenTree cd InvenTree
python manage.py wait_for_db python3 manage.py wait_for_db
sleep 10 sleep 10
# Now we can launch the background worker process # Now we can launch the background worker process
python manage.py qcluster python3 manage.py qcluster

View File

@ -23,7 +23,7 @@ echo "Starting InvenTree server..."
# Wait for the database to be ready # Wait for the database to be ready
cd $INVENTREE_MNG_DIR cd $INVENTREE_MNG_DIR
python manage.py wait_for_db python3 manage.py wait_for_db
sleep 10 sleep 10
@ -31,12 +31,12 @@ echo "Running InvenTree database migrations and collecting static files..."
# We assume at this stage that the database is up and running # We assume at this stage that the database is up and running
# Ensure that the database schema are up to date # Ensure that the database schema are up to date
python manage.py check || exit 1 python3 manage.py check || exit 1
python manage.py migrate --noinput || exit 1 python3 manage.py migrate --noinput || exit 1
python manage.py migrate --run-syncdb || exit 1 python3 manage.py migrate --run-syncdb || exit 1
python manage.py prerender || exit 1 python3 manage.py prerender || exit 1
python manage.py collectstatic --noinput || exit 1 python3 manage.py collectstatic --noinput || exit 1
python manage.py clearsessions || exit 1 python3 manage.py clearsessions || exit 1
# Now we can launch the server # Now we can launch the server
gunicorn -c $INVENTREE_HOME/gunicorn.conf.py InvenTree.wsgi -b 0.0.0.0:$INVENTREE_WEB_PORT gunicorn -c $INVENTREE_HOME/gunicorn.conf.py InvenTree.wsgi -b 0.0.0.0:$INVENTREE_WEB_PORT

View File

@ -6,9 +6,9 @@ sleep 5
# Wait for the database to be ready # Wait for the database to be ready
cd $INVENTREE_MNG_DIR cd $INVENTREE_MNG_DIR
python manage.py wait_for_db python3 manage.py wait_for_db
sleep 10 sleep 10
# Now we can launch the background worker process # Now we can launch the background worker process
python manage.py qcluster python3 manage.py qcluster