magento/inventory

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

fer-gon-red opened this issue · 1 comments

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 create registers into inventory_reservation. For example 2.
  3. Programmatically update some date of Credit Memo (CustomerNote for example)
    $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 the credit memo, it adds two additional ones: 2->4->6->8
  3. Each time, the salable qty is changing

Hi @fer-gon-red. 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