Skip to content

The stock is_salable index value is not correct #39731

Open
@m08110071

Description

@m08110071

Preconditions and environment

  • Magento 2.4.7-p4

Steps to reproduce

  1. Create a simple product with below information and create stock with default source
  2. Assign source for new product and set Qty is 0
  3. Update Advanced Inventory config:
  • Out-of-Stock Threshold: -10
  • Backorders: No Backorders
  1. Run full reindex
  2. Edit product and check Product Salable Quantity is 0
  3. Check value of is_salable column in the table inventory_stock_{storeId}

Expected result

is_salable = 0

Actual result

is_salable = 1

Additional information

The product salable quantity is 0 because min_qty is set to 0 if product is no backorder. It is set by plugin \Magento\InventoryCatalog\Plugin\CatalogInventory\Api\Data\StockItemInterface\AdaptMinQtyToBackordersPlugin::afterGetMinQty
But for indexer, this logic is not applied so min_qty is still -10 and available qty is 0 - (-10) = 10

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Inventory / MSIComponent: DBIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Reported on 2.4.7-p4Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions