jreinke / magento-stock-movements

Magento extension to save products stock movements.
http://www.bubblecode.net/en/2012/02/07/magento-save-product-stock-moves/
79 stars 50 forks source link

Upgrade from stock history to stock movement #22

Open ddoddsr opened 9 years ago

ddoddsr commented 9 years ago

I used the following SQL to upgrade from Stock History, because there didn't seem another way.. But I wonder if this is correct because I don't see the old history through products even though it is in the new table and looks correct. Does is_admin need to be 1? INSERT INTO mage_bubble_stock_movement ( movement_id, item_id, user, user_id, is_admin, qty, is_in_stock, message, created_at)

SELECT sh.history_id, sh.item_id, sh.user, sh.user_id, 0, sh.qty, sh.is_in_stock, sh.message, sh.created_at

FROM mage_cataloginventory_stock_history as sh INNER JOIN mage_catalog_product_entity as pm ON sh.item_id = pm.entity_id