Skip to content

fix(ui): show initial stock fields when PART_CREATE_INITIAL enabled#12415

Merged
SchrodingersGat merged 8 commits into
inventree:masterfrom
br413:fix/12266-initial-stock-fields
Jul 20, 2026
Merged

fix(ui): show initial stock fields when PART_CREATE_INITIAL enabled#12415
SchrodingersGat merged 8 commits into
inventree:masterfrom
br413:fix/12266-initial-stock-fields

Conversation

@br413

@br413 br413 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix Add Part form not showing Initial Stock fields when PART_CREATE_INITIAL is enabled in admin settings
  • Replace incorrect virtual != false gate with globalSettings.isSet('PART_CREATE_INITIAL') in PartForms.tsx
  • Add Playwright regression tests for enabled/disabled setting states

Fixes #12266

Test plan

  • Enable PART_CREATE_INITIAL in settings — Initial Stock section appears in Add Part form
  • Create part with initial quantity and location — stock is created
  • Disable setting — Initial Stock section is hidden
  • Existing Nested Object Field / supplier tests unaffected

@br413
br413 requested a review from SchrodingersGat as a code owner July 17, 2026 16:33
@netlify

netlify Bot commented Jul 17, 2026

Copy link
Copy Markdown

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit eaf415e
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6a5ddc5ea6df4e0008bad0ab

Disable Redis disk persistence to avoid bind-mount permission errors that caused login 500s, and configure localhost as the default site URL.
@SchrodingersGat SchrodingersGat added bug Identifies a bug which needs to be addressed backport Apply this label to a PR to enable auto-backport action User Interface Related to the frontend / User Interface backport-to-1.4.x labels Jul 19, 2026
@SchrodingersGat SchrodingersGat added this to the 1.5.0 milestone Jul 19, 2026
@SchrodingersGat

Copy link
Copy Markdown
Member

@br413 if you setup our pre-commit hooks - https://docs.inventree.org/en/stable/develop/contributing/?h=setup+dev#setup-devtools - then these style issues will be fixed automatically

br413 added 6 commits July 19, 2026 23:43
Avoid strict-mode violations from getByText('Initial Stock') matching multiple form elements.
Avoid strict-mode violations from duplicate Stock tabs on the part page.
Avoid duplicate status_custom_key ORM bug in historical StockItem models.
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.90%. Comparing base (4289f13) to head (eaf415e).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12415      +/-   ##
==========================================
- Coverage   86.91%   86.90%   -0.01%     
==========================================
  Files        1439     1440       +1     
  Lines       94646    94620      -26     
  Branches    11189    11159      -30     
==========================================
- Hits        82259    82233      -26     
  Misses      12322    12322              
  Partials       65       65              
Flag Coverage Δ
backend 91.15% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Backend Apps 92.67% <100.00%> (-0.01%) ⬇️
Backend General 93.49% <100.00%> (+0.01%) ⬆️
Frontend 79.64% <ø> (-0.03%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SchrodingersGat

Copy link
Copy Markdown
Member

@br413 thanks for the contribution 👍

@SchrodingersGat
SchrodingersGat merged commit 44d8d0e into inventree:master Jul 20, 2026
46 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
1.4.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

backport --pr 12415

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Apply this label to a PR to enable auto-backport action backport-to-1.4.x bug Identifies a bug which needs to be addressed User Interface Related to the frontend / User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initial Stock Data fields are missing in Add Part form when enabled

2 participants