Skip to content

Add bulk stock creation from the barcode scan page - #12648

Open
mattstyles333 wants to merge 7 commits into
inventree:masterfrom
mattstyles333:pr/barcode-scan-create-stock
Open

mattstyles333 wants to merge 7 commits into
inventree:masterfrom
mattstyles333:pr/barcode-scan-create-stock

Conversation

@mattstyles333

Copy link
Copy Markdown

Description

The Scan page currently lists barcodes and has a stub action. This fills that in for parts: select scanned parts, then create stock items with a shared quantity and location.

The same part can be scanned more than once (each scan is a package). Other model types still de-duplicate.

Checklist

  • Pull request is targeted against master
  • One feature (frontend only; no API / schema change)
  • User-facing strings go through Lingui (t / Trans)
  • Playwright coverage in existing pui_scan.spec.ts
  • User docs on the barcode scan page
  • No Spex / GitLab / deploy-specific changes

Test plan

  • Scan two different parts, select both, Create Stock Items, confirm quantity/location apply to both
  • Scan the same part twice, confirm both rows appear (no "already scanned")
  • Scan a stock item twice, confirm duplicate is still blocked
  • User without stock add permission: create button disabled
  • Playwright: pui_scan.spec.ts (duplicate parts + create-stock modal)

@netlify

netlify Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit 2157edb
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6ad9faef4a6e2a9e4f50960d
😎 Deploy Preview https://deploy-preview-12648--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 91 (🔴 down 1 from production)
Accessibility: 82 (no change from production)
Best Practices: 92 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread src/frontend/src/pages/Index/Scan.tsx Resolved
Comment thread src/frontend/src/pages/Index/Scan.tsx Resolved
@SchrodingersGat

Copy link
Copy Markdown
Member

@mattstyles333 can you please respond to the questions above

mattstyles333 and others added 4 commits October 17, 2026 02:25
Selected parts can be turned into stock items with a shared quantity
and location. The same part may be scanned more than once so each
physical package becomes its own stock item.

Co-authored-by: Cursor <[email protected]>
Contributing requires user docs for new UI behaviour.

Co-authored-by: Cursor <[email protected]>
BarcodeScanItem.pk is a string; convert it with Number() instead of a
non-overlapping type assertion so tsc can build the Netlify preview.

Co-authored-by: Cursor <[email protected]>
@mattstyles333
mattstyles333 force-pushed the pr/barcode-scan-create-stock branch from 9d3bfa0 to 10088de Compare October 17, 2026 02:25
@mattstyles333

Copy link
Copy Markdown
Author

@SchrodingersGat sorry for the delay, replied above. Reverted the unrelated changes and rebased on latest master.

@SchrodingersGat SchrodingersGat added enhancement This is an suggested enhancement or new feature barcode Barcode scanning and integration User Interface Related to the frontend / User Interface labels Oct 21, 2026
@SchrodingersGat SchrodingersGat added this to the 1.7.0 milestone Oct 21, 2026
@SchrodingersGat

Copy link
Copy Markdown
Member

@mattstyles333 thanks for the changes. LMK if you need any pointers on getting the tests up and running

@mattstyles333

Copy link
Copy Markdown
Author

Thanks! Got them running. Fixed the flaky scan test and merged master. Mind approving the workflows?

(Price Breaks fails on master too, so ignore that one if it fails here.)

@SchrodingersGat

Copy link
Copy Markdown
Member

@matmair are you happy with this?

@matmair

matmair commented Oct 22, 2026

Copy link
Copy Markdown
Member

tbh not really a fan of the current code structure. The scan page in this diff creates a bunch of stock/part specific elements and states that set a band precedence if this was ever to be extended to support more actions/model types

The general function itself looks fine but I have not tested this extensively.

@SchrodingersGat SchrodingersGat modified the milestones: 1.7.0, 1.8.0 Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

barcode Barcode scanning and integration enhancement This is an suggested enhancement or new feature User Interface Related to the frontend / User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants