Compare commits

...

4 Commits

Author SHA1 Message Date
Oliver
a1908f1bf1 Fix "New Sales Order" button (#4832) 2023-05-17 14:48:31 +10:00
Oliver
c29e58aeaa Bug fix for zero quantity pricing (#4766)
- Fix default value for formatPriceRange method
- Display empty value in table

(cherry picked from commit 07d9c2264e)
2023-05-05 22:40:20 +10:00
Oliver
fdaf6d3e19 Implement pagination for stock history tracking API (#4631)
* Bump version number to 0.11.1

* Implement pagination for stock history tracking API

(cherry picked from commit 75696770c6)
2023-04-19 07:09:08 +10:00
Oliver
78badcd65b Bump version number to 0.11.1 (#4630) 2023-04-18 22:56:35 +10:00
5 changed files with 19 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ import common.models
from InvenTree.api_version import INVENTREE_API_VERSION
# InvenTree software version
INVENTREE_SW_VERSION = "0.11.0"
INVENTREE_SW_VERSION = "0.11.1"
def inventreeInstanceName():

View File

@@ -390,7 +390,7 @@
});
{% endif %}
{% if roles.salse_order.add %}
{% if roles.sales_order.add %}
$("#new-sales-order").click(function() {
createSalesOrder({

View File

@@ -1188,7 +1188,12 @@ class StockTrackingList(ListAPI):
"""List all stock tracking entries."""
queryset = self.filter_queryset(self.get_queryset())
serializer = self.get_serializer(queryset, many=True)
page = self.paginate_queryset(queryset)
if page is not None:
serializer = self.get_serializer(page, many=True)
else:
serializer = self.get_serializer(queryset, many=True)
data = serializer.data
@@ -1262,6 +1267,8 @@ class StockTrackingList(ListAPI):
except Exception:
pass
if page is not None:
return self.get_paginated_response(data)
if request.is_ajax():
return JsonResponse(data, safe=False)
else:

View File

@@ -76,7 +76,11 @@ function formatPriceRange(price_min, price_max, options={}) {
var p_min = price_min || price_max;
var p_max = price_max || price_min;
var quantity = options.quantity || 1;
var quantity = 1;
if ('quantity' in options) {
quantity = options.quantity;
}
if (p_min == null && p_max == null) {
return null;

View File

@@ -2063,6 +2063,10 @@ function loadStockTable(table, options) {
currency = baseCurrency();
}
if (row.quantity <= 0) {
return '-';
}
return formatPriceRange(
min_price,
max_price,