mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-07 22:46:06 +00:00
Spree added stock movements to track the movements between stock locations. But we got rid of stock locations and the only stock movements we have now are just records of stock level changes. These records were not created in all cases though and there were also not created for variant overrides (inventory items). And since these records aren't visible anywhere, I think it's best we remove them altogether. I do think that some kind of log would be useful but I don't think that AR records like this are the best solution for that. And the StockMovement model just added complexity to our already complex stock level storage. The actual adjustment of the count_on_hand attribute of the StockItem was performed in an after_create hook of the StockMovement. Now we call it explicitely.