Agence-DnD / PIMGento

PimGento is a Magento extension that allows you to import your catalog from Akeneo CSV files into Magento.
Open Software License 3.0
109 stars 48 forks source link

Updating missing product causes SQL error #125

Closed buttash closed 8 years ago

buttash commented 8 years ago

If you try to update stock for a missing product (ie one disabled within Akeneo and so not in Magento) then the import fails:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (turnbull_uat.cataloginventory_stock_item, CONSTRAINT FK_CATINV_STOCK_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (product_id) REFERENCES catalog_product_entity (entity_id) ON DELE), query was: INSERT INTO cataloginventory_stock_item (product_id, stock_id, qty, is_in_stock) SELECT tmp_pimgento_core_product.entity_id AS product_id, 1 AS stock_id, tmp_pimgento_core_product.qty, IF(qty > 0, 1, 0) AS is_in_stock FROM tmp_pimgento_core_product ON DUPLICATE KEY UPDATE product_id = VALUES(product_id), stock_id = VALUES(stock_id), qty = VALUES(qty), is_in_stock = VALUES(is_in_stock)

As my stock report comes from my ERP system and availability is set in Akeneo I have a problem creating a report with only enabled products.

magentix commented 8 years ago

This issue have been fixed (new control added).