Skip to content

[bug] Prevent editing stock attributes via API - #13384

Open
SchrodingersGat wants to merge 7 commits into
inventree:masterfrom
SchrodingersGat:stock-patch-fix
Open

SchrodingersGat wants to merge 7 commits into
inventree:masterfrom
SchrodingersGat:stock-patch-fix

Conversation

@SchrodingersGat

@SchrodingersGat SchrodingersGat commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Some stock attributes should not be editable after creation - instead follow the expected business logic / workflows.

This PR ensures that the following stock item fields cannot be edited after initial item creation:

  • part
  • quantity
  • location
  • belongs_to
  • customer
  • sales_order
  • purchase_order
  • consumed_by

Some stock attributes should not be editable after creation - instead follow the expected business logic / workflows
@SchrodingersGat SchrodingersGat added this to the 1.8.0 milestone Nov 26, 2026
@SchrodingersGat SchrodingersGat added bug Identifies a bug which needs to be addressed stock Related to Stock models api Relates to the API backport Apply this label to a PR to enable auto-backport action backport-to-1.7.x Apply this label to backport a PR to the 1.7.x branch labels Nov 26, 2026
@netlify

netlify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

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

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

@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.57%. Comparing base (2560725) to head (1392631).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #13384   +/-   ##
=======================================
  Coverage   90.56%   90.57%           
=======================================
  Files         915      911    -4     
  Lines       85236    85226   -10     
  Branches     4349     4327   -22     
=======================================
- Hits        77195    77193    -2     
+ Misses       7016     7015    -1     
+ Partials     1025     1018    -7     
Flag Coverage Δ
backend 94.05% <100.00%> (+<0.01%) ⬆️

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

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

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

Labels

api Relates to the API backport Apply this label to a PR to enable auto-backport action backport-to-1.7.x Apply this label to backport a PR to the 1.7.x branch bug Identifies a bug which needs to be addressed stock Related to Stock models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants