spree/spree — Issue #898: Product#on_hand= doesn't work after save when product is new record
Author: kei-s
Created: 2011-12-21 06:33:22+00:00
State: open

```ruby
p = Spree::Product.new(name: 'name', price: 10)
p.on_hand = 1
p.on_hand #=> 1
# when p is saved, on_hand is gone away.
p.save!
p.on_hand #=> 0

# after once saved, it would be ok.
p.on_hand = 1
p.save!
p.on_hand #=> 1
```

I think the reason is about recaluclate_count_on_hand and save_master.
(Sorry for missing patch, it is complicated for me that product.master relation and initializing variant.)