Closed peekarboo closed 1 year ago
@peekarboo this includes the changes in https://github.com/AmpersandHQ/magento2-disable-stock-reservation/pull/102 ye?
@convenient Yes it does
At first sight this seems to fix my issue indeed. The stock is returned to the original source.
Wait I think this doesn't go well with multiple products. It seems to add the stock to all sources
Product 1 Stock A: 3 Stock B: 2
Product 2: Stock A: 5 Stock B: 5
Order 5x1 and 10x 2
Product 1 Stock A: 0 Stock B: 1
Product 2 Stock A: 0 Stock B: 0
Cancel order
Product 1 Stock A: 8 Stock B: 7 -> 15 instead of 5, so 10 from product 2 are added also.
Product 2 Stock A: 8 Stock B: 6 -> 15 instead of 10, so 5 from Product 1 are added here also
This looks good, but don't know why some tests are failing. Is there anything I can do to help this along?
@barryvdh tests going green now because of this https://github.com/AmpersandHQ/magento2-disable-stock-reservation/blob/4f35d8d2e4c7aa82c6083c989fd790ff07cb5e2f/dev/MagentoTests/Integration/MultipleSourceInventoryTest.php#L206-L233
Seems we were having odd / bad values cached on an object property during the fixture booting that needed cleared before running the tests.
@peekarboo would be good to get a few additional test cases in please
Hey @barryvdh
I believe this is all sorted now, would you agree? Before I merge and tag just wanted to check.
Thanks, Luke
I think so. I tested this patch on my local shop and it seems to work correctly for the cases I encountered before. Thanks!
In case of multiple msi sources, stock is not returned to the relevant stock source. This PR
Assign multiple sources to a stock
Stock A (BE) = 2 Stock B (NL) = 2
Create a pending order with qty 5
Stock A (BE) = 0 Stock B (NL) = 0
Cancel the order
Stock A (BE) = 2 Stock B (NL) = 2
Checklist
./dev/README.md
for how to run tests)