marellocommerce / marello

Marello
Other
51 stars 18 forks source link

Stock not de-allocated on Cancel Action against an order for a custom Workflow #47

Open brainOut opened 5 years ago

brainOut commented 5 years ago

Actually, with the default Workflow (WF), it is not possible to cancel an order after pick and pack transition.

If, for specific needs, you declare the cancel_action available on other transitions, AFTER the pick and pack transition, the stock management is wrong.

What it is expected : Once an order is canceled, if a stock has been allocated, then, this allocation should be de-allocated.

What it is actually done : If an order is cancelled after the pick and pack transition, the allocated stock is not released.

That’s the InventoryUpdateContext that’s created when going into the CancelAction. But the last boolean (true) is for setting the context to ‘virtual’, which basically means it will ‘handle’ the balancedInventory instead of the ‘normal’ one…. credits @24198


EDIT

This also happens when the allocation is set to a transition prior to pick and pack