Closed barryvdh closed 1 year ago
Hey @barryvdh
can you confirm the version of magento you're using?
2.4.5-p1
I'm not really sure where to look. Where is the stock source saved for an order? I can try to debug this case, but not really sure where to start.
@barryvdh looks like https://github.com/AmpersandHQ/magento2-disable-stock-reservation/blob/master/src/etc/db_schema.xml defines order_sources
@barryvdh we have reproduced this issue and are continuing to debug.
@barryvdh please see https://github.com/AmpersandHQ/magento2-disable-stock-reservation/pull/113 there's some WIP going on there, please give feedback on that PR if you have any
Thanks, I did a quick test and that seems to fix it. Edit: Some issues though, commented.
When there are multiple stock sources, it seems to occur that the stock is returned to a different stock source then before.
Tested with a grouped product, with a simple product with multiple stock Stock A = 2 Stock B = 3
Create a pending order with qty 5 Stock A = 0 Stock B = 0
Cancel the order Stock A = 0 Stock B = 5
When we now update the stock A with the API (eg from the ERP), the total QTY is incorrect.
Other case is: default = 0 Stock A = 5 Stock B = 0
Order qty 4 (so all from A) -> Stock A = 1 Cancel order -> All are returned to Stock B instead of A so new situation: default = 0 Stock A = 1 Stock B = 4
Any ideas how to fix this?