安装、更新和删除Inventory Management

Inventory Management模块为单一来源和多来源商家提供所有库存功能和选项,以管理销售渠道的产品数量和库存。 Adobe Commerce和Magento Open Source的2.4.x版本中提供了这些功能。

这些功能和扩展是通过Magento Open Source社区工程计划作为清单项目的一部分开发的。

Inventory Management安装在Adobe Commerce和Magento Open Source的2.3.x和2.4.x版本中,默认启用所有功能。 启用这些清单功能无需执行其他步骤。 从v2.1.x或2.2.x升级可能需要额外的步骤。 请参阅升级Inventory management

建议根据快速入门本地安装进行安装。 使用中继包安装以接收所有Inventory Management模块。

composer.json中继包中的以下行安装Inventory Management:

        magento/inventory-composer-metapackage = 1.1.3

有关Inventory Management中继包版本的列表,请参阅发行说明

Inventory Management安装过程将所有模块添加到<Magento_installation_directory>/app/etc/config.php文件中。 1值表示相应的模块已启用。 添加了以下模块列表:

        'Magento_Inventory' => 1,
        'Magento_InventoryAdminUi' => 1,
        'Magento_InventoryAdvancedCheckout' => 1,
        'Magento_InventoryApi' => 1,
        'Magento_InventoryBundleProduct' => 1,
        'Magento_InventoryBundleProductAdminUi' => 1,
        'Magento_InventoryCatalog' => 1,
        'Magento_InventorySales' => 1,
        'Magento_InventoryCatalogAdminUi' => 1,
        'Magento_InventoryCatalogApi' => 1,
        'Magento_InventoryCatalogSearch' => 1,
        'Magento_InventoryConfigurableProduct' => 1,
        'Magento_InventoryConfigurableProductAdminUi' => 1,
        'Magento_InventoryConfigurableProductIndexer' => 1,
        'Magento_InventoryConfiguration' => 1,
        'Magento_InventoryConfigurationApi' => 1,
        'Magento_InventoryDistanceBasedSourceSelection' => 1,
        'Magento_InventoryDistanceBasedSourceSelectionAdminUi' => 1,
        'Magento_InventoryDistanceBasedSourceSelectionApi' => 1,
        'Magento_InventoryElasticsearch' => 1,
        'Magento_InventoryExportStockApi' => 1,
        'Magento_InventoryIndexer' => 1,
        'Magento_InventorySalesApi' => 1,
        'Magento_InventoryGroupedProduct' => 1,
        'Magento_InventoryGroupedProductAdminUi' => 1,
        'Magento_InventoryGroupedProductIndexer' => 1,
        'Magento_InventoryImportExport' => 1,
        'Magento_InventoryCache' => 1,
        'Magento_InventoryLowQuantityNotification' => 1,
        'Magento_InventoryLowQuantityNotificationApi' => 1,
        'Magento_InventoryMultiDimensionalIndexerApi' => 1,
        'Magento_InventoryProductAlert' => 1,
        'Magento_InventoryRequisitionList' => 1,
        'Magento_InventoryReservations' => 1,
        'Magento_InventoryReservationCli' => 1,
        'Magento_InventoryReservationsApi' => 1,
        'Magento_InventoryExportStock' => 1,
        'Magento_InventorySalesAdminUi' => 1,
        'Magento_InventorySalesFrontendUi' => 1,
        'Magento_InventorySetupFixtureGenerator' => 1,
        'Magento_InventoryShipping' => 1,
        'Magento_InventorySourceDeductionApi' => 1,
        'Magento_InventorySourceSelection' => 1,
        'Magento_InventorySourceSelectionApi' => 1,
        'Magento_InventoryLowQuantityNotificationAdminUi' => 1,
        'Magento_InventoryShippingAdminUi' => 1,
        'Magento_InventoryGraphQl' => 1,

启用Inventory Management功能

安装、升级或更新后,Admin中的​ Manage Stock ​选项默认启用。 此选项启用库存跟踪和管理,但不影响模块状态。 要禁用模块,请参阅下一部分。

有关配置的详细信息,请参阅配置Inventory management

禁用Inventory management

IMPORTANT
强烈建议使用默认Inventory Management模块。 用于已禁用Inventory Management模块的系统的替代CatalogInventory模块现已弃用。 禁用Inventory Management模块可能会导致系统不稳定并导致各种问题。

您可能要禁用Inventory Management模块以:

  • 加速从2.0.x、2.1.x、2.2.x或2.3.x迁移到2.4.x的商户升级过程。
  • 使用自定义或第三方库存和订单管理系统模块。

有关如何禁用适用模块的信息,请参阅​ 安装指南 ​中的启用或禁用模块页面。

完成后,系统将在<Magento_installation_directory>/app/etc/config.php中提供模块和值的列表,开头为:

   'Magento_Inventory' => 0,
   'Magento_InventoryAdminUi' => 0,
   'Magento_InventoryAdvancedCheckout' => 0,
   ...
IMPORTANT
如果安装了OMS连接器模块,请确保不禁用Magento_InventoryMessageBus模块,该模块是连接器模块。 需要将连接器与OMS一起使用。

删除Inventory management

IMPORTANT
强烈建议使用默认Inventory Management模块。 替代模块CatalogInventory用于已移除Inventory Management模块的系统,现已弃用。 删除Inventory Management模块可能会导致系统不稳定并导致各种问题。

如果您选择不使用Inventory Management功能,则可以删除(卸载)这些模块。 要通过编辑器文件删除所有模块,请将以下内容添加到composer.json

"replace": {
        "magento/module-inventory": "*",
        "magento/module-inventory-admin-ui": "*",
        "magento/module-inventory-advanced-checkout": "*",
        "magento/module-inventory-api": "*",
        "magento/module-inventory-bundle-product": "*",
        "magento/module-inventory-bundle-product-admin-ui": "*",
        "magento/module-inventory-cache": "*",
        "magento/module-inventory-catalog": "*",
        "magento/module-inventory-catalog-admin-ui": "*",
        "magento/module-inventory-catalog-api": "*",
        "magento/module-inventory-catalog-search": "*",
        "magento/module-inventory-configurable-product": "*",
        "magento/module-inventory-configurable-product-admin-ui": "*",
        "magento/module-inventory-configurable-product-indexer": "*",
        "magento/module-inventory-configuration": "*",
        "magento/module-inventory-configuration-api": "*",
        "magento/module-inventory-distance-based-source-selection": "*",
        "magento/module-inventory-distance-based-source-selection-admin-ui": "*",
        "magento/module-inventory-distance-based-source-selection-api": "*",
        "magento/module-inventory-export-stock": "*",
        "magento/module-inventory-export-stock-api": "*",
        "magento/module-inventory-elasticsearch": "*",
        "magento/module-inventory-graph-ql": "*",
        "magento/module-inventory-grouped-product": "*",
        "magento/module-inventory-grouped-product-admin-ui": "*",
        "magento/module-inventory-grouped-product-indexer": "*",
        "magento/module-inventory-import-export": "*",
        "magento/module-inventory-indexer": "*",
        "magento/module-inventory-low-quantity-notification": "*",
        "magento/module-inventory-low-quantity-notification-admin-ui": "*",
        "magento/module-inventory-low-quantity-notification-api": "*",
        "magento/module-inventory-multi-dimensional-indexer-api": "*",
        "magento/module-inventory-product-alert": "*",
        "magento/module-inventory-requisition-list": "*",
        "magento/module-inventory-reservations": "*",
        "magento/module-inventory-reservations-api": "*",
        "magento/module-inventory-reservation-cli": "*",
        "magento/module-inventory-sales": "*",
        "magento/module-inventory-sales-admin-ui": "*",
        "magento/module-inventory-sales-api": "*",
        "magento/module-inventory-sales-frontend-ui": "*",
        "magento/module-inventory-setup-fixture-generator": "*",
        "magento/module-inventory-shipping": "*",
        "magento/module-inventory-shipping-admin-ui": "*",
        "magento/module-inventory-source-deduction-api": "*",
        "magento/module-inventory-source-selection": "*",
        "magento/module-inventory-source-selection-api": "*",
        "magento/module-inventory-visual-merchandiser": "*",
        "magento/module-inventory-swatches-frontend-ui": "*",
        "magento/module-inventory-quote-graph-ql": "*",
        "magento/module-inventory-in-store-pickup": "*",
        "magento/module-inventory-in-store-pickup-sales": "*",
        "magento/module-inventory-in-store-pickup-admin-ui": "*",
        "magento/module-inventory-in-store-pickup-sales-admin-ui": "*",
        "magento/module-inventory-in-store-pickup-api": "*",
        "magento/module-inventory-in-store-pickup-sales-api": "*",
        "magento/module-inventory-in-store-pickup-frontend": "*",
        "magento/module-inventory-in-store-pickup-shipping": "*",
        "magento/module-inventory-in-store-pickup-graph-ql": "*",
        "magento/module-inventory-in-store-pickup-shipping-admin-ui": "*",
        "magento/module-inventory-in-store-pickup-multishipping": "*",
        "magento/module-inventory-in-store-pickup-shipping-api": "*",
        "magento/module-inventory-in-store-pickup-quote": "*",
        "magento/module-inventory-in-store-pickup-webapi-extension": "*",
        "magento/module-inventory-in-store-pickup-quote-graph-ql": "*",
        "magento/module-inventory-configurable-product-frontend-ui": "*",
        "magento/module-inventory-catalog-search-configurable-product": "*",
        "magento/module-inventory-catalog-search-bundle-product": "*",
        "magento/module-inventory-catalog-frontend-ui": "*",
        "magento/module-inventory-bundle-import-export": "*",
        "magento/module-inventory-bundle-product-indexer": "*"
    }

完成此更改后,运行composer install,此时将自动删除这些Inventory management模块。

升级Inventory management

早期Commerce版本

将现有2.1.x、2.2.x或2.3.x安装升级或更新到Adobe Commerce或Magento Open Source 2.4.x时,Inventory Management模块默认处于禁用状态。 为了防止向后不兼容的升级并更好地支持Order Management (OMS),使用此默认设置是一种预防措施。

NOTE
Order Management不支持Inventory Management。 升级时,Inventory Management模块被禁用,以允许OMS和Commerce 2.3.x无缝工作。

要启用Inventory Management模块:

  1. 编辑<Commerce_installation_directory>/app/etc/config.php文件。

  2. 将所有清单模块从0修改为1以启用。

  3. 更新数据库:

    code language-bash
    bin/magento setup:upgrade
    
  4. 清理缓存:

    code language-bash
    bin/magento cache:clean
    

建议您在升级后使用保留不一致命令。 升级时,您的所有产品都会添加到默认库存。 如果您有待定订单,则这些命令会正确更新您的可销售数量和预留,以便进行销售和订单履行。

早期Inventory Management版本

从以前版本的Inventory Management升级到最新版本时,请按照正常的扩展升级步骤操作。

对于最新版本,请更新您的中继包版本:

        magento/inventory-composer-metapackage = 1.1.3

有关Commerce升级的更多信息,请参阅以下指南:

recommendation-more-help
c1792860-ac60-428b-ad4b-59517d4ea712