inventory icon indicating copy to clipboard operation
inventory copied to clipboard

No default stock location after enabling MSI

Open TectonicKestrel opened this issue 4 years ago • 3 comments

Until recently i was using Magento 2.3.3-p1 with MSI disabled (disabled all related modules). I use a module to import my stock and pricing on a daily basis and this was not compatible with MSI until now. They have now released a compatible version, so i updated the module, enabled MSI and also updated to magento 2.3.6. When i go to "Stores" > "Stocks" I dont have any location listed there, not even the default Stock which is meant to be created when MSI is enabled i believe. I could not find any error in the logs after enabling MSI that may cause this. When i enable the MSI feature in my import module the location for that module appears but salable quantity stay at 0 and the module developer says this could be because there is no default location.

In my database, inventory_source, inventory_source_item and inventory_source_stock_link are all empty. I have seen various SQL commands to add data to these tables but none work. Most of it seems to be down to the foreign key for the "source_code" and/or "Stock_id" field. The view inventory_stock_1 is created. The error i get when running command: INSERT INTO inventory_source_stock_link (link_id, stock_id, source_code, priority) VALUES ('1', '1', 'default', '1'); is #1452 - Cannot add or update a child row: a foreign key constraint fails (db_name.inventory_source_stock_link, CONSTRAINT INVENTORY_SOURCE_STOCK_LINK_STOCK_ID_INVENTORY_STOCK_STOCK_ID FOREIGN KEY (stock_id) REFERENCES inventory_stock (stock_id) )

After enabling MSI and letting the import module using MSI stock should import and the salable quantity be the total stock i have available from each source. The sources do work when enabled.

Is there anyway to create the default stock and therefore hopefully get MSI working as it should. The import module i use is https://github.com/stockchannel/sinchimport

TectonicKestrel avatar Dec 01 '20 09:12 TectonicKestrel

Hi @alexsmith2709. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar Dec 01 '20 09:12 m2-assistant[bot]

A fresh install does not have this issue, does anyone know what could have caused this issue on my initial 2.3.3 install and a way to fix this without having to reinstall my live site?

TectonicKestrel avatar Dec 05 '20 19:12 TectonicKestrel

Estou com com o mesmo problema, ao habilitar o MSI não consigo adicionar produtos ao carrinho tambem tentei editar o mysql com o mesmos comandos e obtive o mesmo resultado

adorobeleza avatar Jun 20 '21 03:06 adorobeleza