Closed buttash closed 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)
turnbull_uat
cataloginventory_stock_item
FK_CATINV_STOCK_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_ID
product_id
catalog_product_entity
entity_id
stock_id
qty
is_in_stock
tmp_pimgento_core_product
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.
This issue have been fixed (new control added).
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
, CONSTRAINTFK_CATINV_STOCK_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_ID
FOREIGN KEY (product_id
) REFERENCEScatalog_product_entity
(entity_id
) ON DELE), query was: INSERT INTOcataloginventory_stock_item
(product_id
,stock_id
,qty
,is_in_stock
) SELECTtmp_pimgento_core_product
.entity_id
ASproduct_id
, 1 ASstock_id
,tmp_pimgento_core_product
.qty
, IF(qty
> 0, 1, 0) ASis_in_stock
FROMtmp_pimgento_core_product
ON DUPLICATE KEY UPDATEproduct_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.