From 2ffc5305d74eeb54a4c20052397c70f779b0f42a Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Sat, 19 Jan 2019 23:15:04 +0000 Subject: [PATCH] Adapted VariantStock to handle on_hand string values (product import is set on_hand with string values) --- app/models/concerns/variant_stock.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/variant_stock.rb b/app/models/concerns/variant_stock.rb index 0a7ba06d28..09028f4d91 100644 --- a/app/models/concerns/variant_stock.rb +++ b/app/models/concerns/variant_stock.rb @@ -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