magento / inventory

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

Extra compensation reservation (inventory_reservation) in any update of credit memo #3340

Open tales-desde-mileto opened 2 years ago

tales-desde-mileto commented 2 years ago

Preconditions (*)

  1. Magento 2.4.3-p1 with magento/module-inventory 1.2.1-p1
  2. With small data: profiles/ce/small.xml

Steps to reproduce (*)

  1. Create a full Credit Memo with not checked Return to Stock for one of products (for example: sales_creditmemo.entity_id = 1)
  2. It creates registers into inventory_reservation. For example #2 lines.
  3. Programmatically update some date of Credit Memo (CustomerNote for example). Something like this: $soyUnMemo = $objectManager->create('Magento\Sales\Model\Order\Creditmemo')->load('1'); $soyUnMemo->setCustomerNote('Hi'); $soyUnMemo->save();

Expected result (*)

  1. The count of registers on inventory_reservation should be 2

Actual result (*)

  1. The count of registers on inventory_reservation is 4
  2. And each time that we update Programmatically the credit memo, it adds two additional ones: 2->4->6->8
  3. Each time, the salable qty is changing
m2-assistant[bot] commented 2 years ago

Hi @tales-desde-mileto. 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