-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Fix errant stock adjustment when saving partially refunded orders. #31172
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
Conversation
0c18184 to
41e2ce4
Compare
|
Hey, is this one ready for review? Just checking if we should assign a reviewer or it's WIP. Thanks! |
Yes it is, I'll assign a reviewer. |
41e2ce4 to
4b10190
Compare
|
Can't imagine it's related to this change (so perhaps worth rebasing on latest trunk) but noting there is fail via the test coverage check: (Re-running checks did not clear it.) |
barryhughes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, tried a few permutations of the testing instructions and it works well.
@jeffstieler: hitting approve but will let you merge (there is a failing check—most likely unrelated—but letting you take a look first, just in case).
Prevents fully restocked items on partially refunded orders from having stock reduced on subsequent order updates.
4b10190 to
123dfe3
Compare
|
Rebasing off |
|
Hi @jeffstieler, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:
|
All Submissions:
Changes proposed in this Pull Request:
Closes #30618.
This PR seeks to resolve the errant stock adjustment on restocked items in partially refunded orders by preserving the
_reduced_stockand_restock_refunded_itemsorder item metadata value sowc_maybe_adjust_line_item_product_stock()correctly identifies no$diffbetween the ordered quantity and the amount deducted and restocked.I've added unit test and E2E test coverage, but I'm still unsure of all of the potential ramifications of keeping the
_reduced_stockmetadata around (perhaps extensions are looking for it?).How to test the changes in this Pull Request:
Other information:
Changelog entry
Fix - errant stock adjustment on restocked items when saving partially refunded orders.
FOR PR REVIEWER ONLY: