Adapted VariantStock to handle on_hand string values (product import is set on_hand with string values)

This commit is contained in:
luisramos0
2019-01-19 23:15:04 +00:00
parent fc1004cb3a
commit 2ffc5305d7

View File

@@ -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