magento / inventory

Magento Inventory Project (a.k.a MSI)
Open Software License 3.0
338 stars 248 forks source link

After skipping the source quantity from configurable products child variants edit, the quantity set to zero (blank) #3379

Closed Varshal24 closed 9 months ago

Varshal24 commented 1 year ago

Preconditions (*)

  1. Magento 2.4.5-p1
  2. Inventory 1.2.3
  3. Magento 2.4.6
  4. Inventory 1.2.4

Steps to reproduce (*)

  1. Create one or more extra sources

  2. Create configurable products

  3. Add one or more simple product

  4. Set simple product quantity using default source and save the product

    image

  5. Then go into Edit Configuration and select (Skip quantity at this time) in the Quantity per source and than save the product

    image

  6. The quantity will remove from the simple product.

    image

  7. In this inventory_source_item the entry of those products quatity will also remove.

Description (*)

The Quantity is removed from configurable products child variants. And the entry of those source_item from inventory_source_item table is removed because of that the product is showing out of stock in the front end.

Expected result (*)

  1. If we select (Skip quantity at this time) option in Quantity per source than the quantity shouldn’t have to change. It should have to be the same as before.

Actual result (*)

  1. After saving the config product with simple product selecting (Skip quantity at this time) option in Quantity per source than the simple product quantity is set to blank.
m2-assistant[bot] commented 1 year ago

Hi @Varshal24. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information. Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

danielpfarmer commented 1 year ago

We're seeing the same issue. Has anyone found a solution to this?

IanFiretoys commented 1 year ago

same here, I logged this on the main magento branch here: https://github.com/magento/magento2/issues/37433 as it affects non-MSI installations by simply overwriting the source qty of all existing children in the configurable rather than removing the source outright

Varshal24 commented 9 months ago

This issue has been solved in the magento developer branch . These are the two commits regarding it (https://github.com/magento/inventory/commit/204131ea0ee8383d099db15ae3475ee957b52480) & (https://github.com/magento/magento2/commit/1e17b1e86203e2989ad2fb15b0f4e97c1d5d1def)) .

yurirn commented 5 months ago

@Varshal24 How do I apply this fix in Magento 2.4.5?

Varshal24 commented 5 months ago

@yurirn You can fix this issue by creating an patch.

devphp74 commented 5 months ago

@Varshal24 I have the same problem, I saw that you said to apply a patch,

but which of the commits do I have to apply? (204131e) or (magento/magento2@1e17b1e))

can you help me?

Varshal24 commented 5 months ago

@devphp74 You can use (https://github.com/magento/inventory/commit/204131ea0ee8383d099db15ae3475ee957b52480) to resolve the issue. However, I suggest that the best approach is to upgrade your shop to the latest version of Magento, which will automatically resolve this issue.