Skip to content

[UI] Part default location is not preselected when adding a Stock Item #12740

Closed

Description

@mlewand

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

When adding a new Stock Item from the Stock tab of a Part, the "Stock Location" field is left empty even when the Part has a "Default Location" configured.

I would expect the Part's default location to be used as the initial value for the new Stock Item, while still allowing the user to change it before submitting.

The official InvenTree mobile app already behaves this way: when adding stock for the same Part, the Part's default location is automatically preselected.

This appears to be a Platform UI inconsistency rather than a limitation of the underlying data model.

This is related to, but different from, #12304. That issue concerns making the default location easier to find in the location selector, whereas this issue concerns using the configured default location as the initial value when creating stock for a known Part.

Steps to Reproduce

  1. Create or edit a Part.
  2. Set its Default Location to a valid stock location.
  3. Save the Part.
  4. Open the Part details page.
  5. Go to the Stock tab.
  6. Click Add Stock Item (+).
  7. Observe the Stock Location field in the "Add Stock Item" dialog.

The field is empty, even though the Part has a Default Location configured.

For comparison, performing the equivalent operation for the same Part in the official InvenTree mobile app preselects the Part's Default Location.

Expected behaviour

When creating a new Stock Item from a specific Part, if that Part has a default_location configured, the Stock Location field should initially be set to that location.

The user should still be able to select a different location before submitting.

If the Part does not have a default location configured, leaving the field empty would be expected.

This would also make the Platform UI behavior consistent with the official InvenTree mobile app.

Deployment Method

Docker

Version Information

InvenTree-Version: 1.5.2
Django Version: 5.2.16
Commit Hash: f15e35c
Commit Date: 2026-08-25
Commit Branch: null
Database: django.db.backends.postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-6.6.114.1-microsoft-standard-WSL2-x86_64-with-glibc2.41
Installer: DOC
Active plugins: [{"name":"InvenTreeBarcode","slug":"inventreebarcode","version":"2.2.0"},{"name":"BOM Exporter","slug":"bom-exporter","version":"1.1.0"},{"name":"InvenTree Exporter","slug":"inventree-exporter","version":"1.0.0"},{"name":"Parameter Exporter","slug":"parameter-exporter","version":"2.0.0"},{"name":"InvenTreeEmailNotifications","slug":"inventree-email-notification","version":"1.0.0"},{"name":"InvenTreeUINotifications","slug":"inventree-ui-notification","version":"1.0.0"},{"name":"InvenTreeCurrencyExchange","slug":"inventreecurrencyexchange","version":"1.0.0"},{"name":"InvenTreeMachines","slug":"inventree-machines","version":"1.0.0"},{"name":"InvenTreeLabel","slug":"inventreelabel","version":"1.1.0"},{"name":"InvenTreeLabelMachine","slug":"inventreelabelmachine","version":"1.0.0"},{"name":"Brother Labels","slug":"brother","version":"2.0.6"}]

Try to reproduce on the demo site

I tried to reproduce

Is the bug reproducible on the demo site?

Reproducible

Relevant log output

Activity

  1. added
    bug
    question
    triage:not-checked
    on Aug 29, 2026
  2. added
    User Interface
    and removed
    question
    triage:not-checked
    on Aug 29, 2026
  3. added this to the 1.6.0 milestone on Aug 29, 2026
  4. SchrodingersGat commented on Aug 30, 2026

    @SchrodingersGat
    Member

    @mlewand thanks for reporting - fix incoming in #12742

  5. mlewand commented on Aug 31, 2026

    @mlewand
    Author

    Fantastic, thank you @SchrodingersGat for quick turnaround! 🎉

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

    User Interfacebug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions