Skip to content

[Bug]: Draft Order Edit allocates inventory even for draft orders (unexpected behavior) #13773

@Alessio-Polaris

Description

@Alessio-Polaris

Package.json file

not relevant

Node.js version

not relevant

Database and its version

not relevant

Operating system name and version

not relevant

Browser name

No response

What happended?

When creating a draft order, no inventory allocation is expected — and this is correct.
However, when performing an edit session on an existing draft order (using the beginEdit / updateItem / addItems / confirmEdit flow), inventory reservations are unexpectedly created for the updated or added items.

This causes draft orders — which should not allocate inventory — to reserve stock in the inventory service after an edit confirmation.

Expected behavior

Create a draft order with items x, y, z.

Begin an edit session and add new items a and b.
In the same edit session, also update "variant x" quantity

No inventory reservations should ever be created for draft orders, since they are not finalized or confirmed orders.
Draft orders are typically used in POS or admin-side workflows before a sale is completed.

Actual behavior

After confirmEdit, reservations are created only for the items modified during the edit — in this example:
items a, b, and x
items y, z remain unreserved.

This behavior happens because confirmDraftOrderEditWorkflow internally calls reserveInventoryStep.

Link to reproduction repo

not relevant

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions