-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Product qty is incremented when comment is added on a Credit Memo from SOAP API v2 #1517
Comments
is salesOrderCreditmemoAddComment is method you call? |
@fballiano Yes that's method being called. I think you misunderstood, I meant the inventory qty of the product and not the Creditmemo items' qty. I updated the description to make it more clear. |
the last comment on my screenshot was added via soap but the qty was kept at 1. |
@fballiano Yes but I'm not talking about the refunded qty in the creditmemo, can you note the qty of the product in the inventory before vs. after adding the comment and see if it changes? |
so it's not the refunded_qty but the qty that goes back to stock? |
oki, understood and reproduced |
I just submitted PR #1575 which solves the problem on my local installation. |
Adding a comment to a creditmemo keeps "restocking" the products to the inventory, as explained in issue #1517 $creditmemo->getCommentsCollection()->save() is used in Mage_Adminhtml_Sales_Order_CreditmemoController::addCommentAction() and works correctly because it doesn't trigger a "save" on the creditmemo, but only on the comments.
Adding a comment to a creditmemo keeps "restocking" the products to the inventory, as explained in issue OpenMage/magento-lts#1517 $creditmemo->getCommentsCollection()->save() is used in Mage_Adminhtml_Sales_Order_CreditmemoController::addCommentAction() and works correctly because it doesn't trigger a "save" on the creditmemo, but only on the comments.
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
After a long debugging session, it was found that the problem is arising from
Mage_CatalogInventory_Model_Observer#refundOrderInventory
which is observing thesales_order_creditmemo_save_after
event that is dispatched after anysave()
of the Credit Memo, this is because in the event observer method (refundOrderInventory
), there is no check to see whether the creditmemo object is new or not therefore it keeps adding the qty for all order items on every save.Thanks
The text was updated successfully, but these errors were encountered: