Compare commits

..

4 Commits

Author SHA1 Message Date
github-actions[bot]
1c4362c42a Prevent div-by-zero error (#4967) (#4968)
- Div-by-zero could occur when calculating how many items can be built for a part
- Might result if (somehow) the BomItem has a quantity of zero

(cherry picked from commit d8965c6c2b)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2023-06-05 13:49:39 +10:00
github-actions[bot]
5b6d999091 Fix for 'available' filter (#4952) (#4954)
- Available filter also requires "in stock"

(cherry picked from commit c0dafe155f)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2023-06-02 17:06:09 +10:00
Miklós Márton
970714a76f Fix completeSalesOrderShipment typo in sales_order.js (#4908) 2023-05-27 17:38:14 +10:00
Oliver Walters
59214cacbf Bump version to 0.11.3 2023-05-27 17:37:43 +10:00
4 changed files with 9 additions and 3 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.2"
INVENTREE_SW_VERSION = "0.11.3"
def inventreeInstanceName():

View File

@@ -1293,6 +1293,11 @@ class Part(InvenTreeBarcodeMixin, MetadataMixin, MPTTModel):
)
for item in queryset.all():
if item.quantity <= 0:
# Ignore zero-quantity items
continue
# Iterate through each item in the queryset, work out the limiting quantity
quantity = item.available_stock + item.substitute_stock

View File

@@ -434,7 +434,8 @@ class StockFilter(rest_filters.FilterSet):
"""
if str2bool(value):
# The 'quantity' field is greater than the calculated 'allocated' field
return queryset.filter(Q(quantity__gt=F('allocated')))
# Note that the item must also be "in stock"
return queryset.filter(StockItem.IN_STOCK_FILTER).filter(Q(quantity__gt=F('allocated')))
else:
# The 'quantity' field is less than (or equal to) the calculated 'allocated' field
return queryset.filter(Q(quantity__lte=F('allocated')))

View File

@@ -379,7 +379,7 @@ function completePendingShipments(order_id, options={}) {
*/
function completePendingShipmentsHelper(shipments, shipment_idx, options={}) {
if (shipment_idx < shipments.length) {
completeSalseOrderShipment(shipments[shipment_idx].pk,
completeSalesOrderShipment(shipments[shipment_idx].pk,
{
buttons: [
{