mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-01 21:47:16 +00:00
Fix capping quantity to stock levels by always validating line items with quantity zero
Stock::Quantifier.can_supply? returns false for an input of zero when stock level is negative
This commit is contained in:
@@ -4,6 +4,7 @@ Spree::Stock::AvailabilityValidator.class_eval do
|
||||
return if line_item.skip_stock_check
|
||||
|
||||
quantity = adapt_line_item_quantity_to_inventory_units(line_item)
|
||||
return if quantity == 0
|
||||
|
||||
validate_quantity(line_item, quantity)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user