vendure-ecommerce/vendure

Extra allocation when canceling order

Opened this issue · 1 comments

timcv commented

We have a problem that when we cancel an order, an extra allocation is added for the order line that got canceled.

Is there a reason for running createAllocationsForOrderLines(ctx, orderLineInput) after createCancellationsForOrderLines(ctx, orderLineInput) is executed?

See image bellow:

Screenshot 2024-05-31 at 10 11 40

I'm looking into the possible reasons for this like, and it looks like it was added in response to this issue:

That solution was for the case where a Fulfillment gets cancelled, but not the entire order. If the entire order is cancelled, then it does not make sense to have any stock allocated to it of course.

Can you provide the exact steps to reproduce the disparity in allocations? From studying the code paths by eye it is not clear to me how this is happening.