mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Adapted VariantStock to handle on_hand string values (product import is set on_hand with string values)
This commit is contained in:
@@ -183,7 +183,7 @@ module VariantStock
|
||||
# Calling stock_item.adjust_count_on_hand will bypass filling backorders and creating stock movements
|
||||
# If that was required we could call self.move
|
||||
def overwrite_stock_levels(new_level)
|
||||
stock_item.adjust_count_on_hand(new_level - stock_item.count_on_hand)
|
||||
stock_item.adjust_count_on_hand(new_level.to_i - stock_item.count_on_hand)
|
||||
end
|
||||
|
||||
# There shouldn't be any other stock items, because we should
|
||||
|
||||
Reference in New Issue
Block a user