Skip to content

Stock already allocated to a transfer order can be allocated again to a build order #13286

Closed

Description

@jordan-dimov

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

I have a stock item of 10 that is fully allocated to an issued transfer order. If I try to allocate it to a build order with the normal allocate action, InvenTree correctly says nothing is available.

But if I create the build allocation through /api/build/item/ instead, it is accepted. Now the same 10 are allocated to both the transfer order and the build order, so 20 allocated from 10.

The screenshots show both allocations on the same stock item. I think the build item check might not be counting transfer order allocations, while the other checks do.

1-build-order-has-10-allocated-from-item-of-10 2-transfer-order-also-has-10-allocated-same-item

Steps to Reproduce

  1. Make a component part, and an assembly part with that component in its BOM. On the demo, new parts are trackable by default; I had to turn trackable off on both, otherwise the build item call asks for a build output
  2. Add a stock item of 10 for the component
  3. Make a transfer order for the component (quantity 10), issue it, and allocate all 10 from that stock item
  4. Make a build order for 10 of the assembly and issue it
  5. POST /api/build/<build id>/allocate/ with that stock item and quantity 10: refused, "Available quantity (0) exceeded" (correct)
  6. POST /api/build/item/ with {"build_line": <the line id>, "stock_item": <stock item id>, "quantity": 10}: accepted (201)
  7. Open the stock item's Allocations tab: 10 to the build order and 10 to the transfer order

Expected behaviour

Step 6 should be refused the same way step 5 is.

Deployment Method

None

Version Information

1.8.0 dev

Try to reproduce on the demo site

I tried to reproduce

Is the bug reproducible on the demo site?

Reproducible

Relevant log output

on the demo it's BO0029, TO-0006 and the Component D02 stock item (batch D02), until the daily reset

I have reviewed this report for correctness and filled out all sections.

  • I have checked this report. I acknowledge that filing bugs via AI agents without review might lead to being blocked.

Activity

  1. added
    bug
    question
    on Nov 14, 2026
  2. added theissue type on Nov 14, 2026
  3. added
    triage:not-checked
    on Nov 14, 2026
  4. added a commit that references this issue on Nov 14, 2026
    0c613ec
  5. added this to the 1.8.0 milestone on Nov 14, 2026
  6. removed
    question
    triage:not-checked
    on Nov 14, 2026
  7. SchrodingersGat commented on Nov 14, 2026

    @SchrodingersGat
    Member

    @jordan-dimov thanks for reporting

  8. added a commit that references this issue on Nov 14, 2026
    3572714
  9. added a commit that references this issue on Nov 15, 2026
    3701f52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions