Assign Inventory source while programmatically creating product
0
I have a custom script that read csv and create products programmatically, it was working fine with Magento 2.2.6 , now I upgraded it to Magento 2.3 , and with upgradation I configured Multi Source Inventory. The issue I am facing is that while saving the product it is throwing error " The stock item was unable to be saved. Please try again. " I am getting below error in log main.CRITICAL: The stock item was unable to be saved. Please try again. {"exception":"[object] (Magento\Framework\Exception\CouldNotSaveException(code: 0): The stock item was unable to be saved. Please try again. at /magento_root/vendor/magento/module-catalog-inventory/Model/Stock/StockItemRepository.php:187, Magento\Framework\Exception\CouldNotSaveException(code: 0): Could not save Source Item at /magento_root...