Repository navigation
Description
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
- Create or edit a Part.
- Set its Default Location to a valid stock location.
- Save the Part.
- Open the Part details page.
- Go to the Stock tab.
- Click Add Stock Item (
+). - 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
Activity
SchrodingersGat commentedon Aug 30, 2026
@mlewand thanks for reporting - fix incoming in #12742
mlewand commentedon Aug 31, 2026
Fantastic, thank you @SchrodingersGat for quick turnaround! 🎉