-
Notifications
You must be signed in to change notification settings - Fork 63
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
Update SourceRepository.php to return stock to relevant stock source #113
Conversation
@peekarboo this includes the changes in #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 Product 2: Order 5x1 and 10x 2 Product 1 Product 2 Cancel order Product 1 Product 2 |
Filter sources based on sku
This looks good, but don't know why some tests are failing. Is there anything I can do to help this along? |
Update `MultipleSourceInventoryTest.php` handling - Patch a bug in 2.4.4 that stops fixtures working in integration tests because tables are prefixed with trv_. I want to keep the versions under test as clear as possible, but this wont affect most use cases and will allow us to get the tests going through - Clear the sales channel cache before running the tests - Some DAMP vs DRY readability changes https://stackoverflow.com/a/11837973/4354325 - this removed some dead code also
@barryvdh tests going green now because of this magento2-disable-stock-reservation/dev/MagentoTests/Integration/MultipleSourceInventoryTest.php Lines 206 to 233 in 4f35d8d
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, |
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)