mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Don't decrement variant stock if override is on_demand
This commit is contained in:
@@ -41,7 +41,11 @@ module OpenFoodNetwork
|
||||
# - updates variant_override.count_on_hand
|
||||
# - does not create stock_movement
|
||||
# - does not update stock_item.count_on_hand
|
||||
# If it is a variant override with on_demand:
|
||||
# - don't change stock or call super (super would change the variant's stock)
|
||||
def move(quantity, originator = nil)
|
||||
return if @variant_override.andand.on_demand
|
||||
|
||||
if @variant_override.andand.stock_overridden?
|
||||
@variant_override.move_stock! quantity
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user