Skip to content

feat(barcode): continuous multi-scan mode + build-order scan-to-allocate#11682

Open
verysleepylemon wants to merge 2 commits intoinventree:masterfrom
verysleepylemon:feat/continuous-barcode-scan
Open

feat(barcode): continuous multi-scan mode + build-order scan-to-allocate#11682
verysleepylemon wants to merge 2 commits intoinventree:masterfrom
verysleepylemon:feat/continuous-barcode-scan

Conversation

@verysleepylemon
Copy link
Copy Markdown

Continuous multi-scan for stock location (fixes #11138) and scan-to-allocate on build orders (addresses #11278). See commit message for details.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 7, 2026

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

Name Link
🔨 Latest commit 7c875dd
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/69d7b63640a19f00088923f8


// ---------------------------------------------------------------------------
// Scan-to-allocate: scan a stock item barcode to directly allocate it to
// this build order. Resolves: https://github.com/inventree/InvenTree/issues/11278
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the GH issue reference from the code here

@SchrodingersGat SchrodingersGat added enhancement This is an suggested enhancement or new feature barcode Barcode scanning and integration api Relates to the API build Build orders User Interface Related to the frontend / User Interface labels Apr 7, 2026
@SchrodingersGat SchrodingersGat added this to the 1.4.0 milestone Apr 7, 2026
@SchrodingersGat
Copy link
Copy Markdown
Member

SchrodingersGat commented Apr 7, 2026

@verysleepylemon great addition, this is a huge productivity boost! Overall this looks really good - please refer to the notes below, and also inline in the code

Button Placement

image

Please move the "Scan to allocate" button into the "barcode actions" menu to avoid cluttering.

Stay Open Button

Please change this checkbox to a <Switch> element and move to the bottom of the dialog:

image

Much like we already do for the "keep form open" switch:

image

Clear Log Button

To accommodate the change as above, move the "Clear log" button back up into the modal content:

image

Error Handling

It appears that the current implementation is not fully functional - see error code below:

image

);

try {
await api.post(apiUrl(ApiEndpoints.build_order_allocate, build.pk), {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api object is not defined in this context. You will need to define it like so:

const api = useApi();

// Check if this part has an outstanding un-allocated build line
let buildLineMatches: any = null;
try {
const lineResp = await api.get(apiUrl(ApiEndpoints.build_line_list), {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api object does not exist

const lineResp = await api.get(apiUrl(ApiEndpoints.build_line_list), {
params: { build: build.pk, part: stockItem.part, allocated: false }
});
buildLineMatches = lineResp.data;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think you have observed the actual data being returned here. Even when returning a correct response, the barcode form errors out. Please inspect and fix.

error: t`This component is not required (or is already fully allocated) in this build order`
};
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to handle the case where more than one line item is returned (ambiguous)?

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

Labels

api Relates to the API barcode Barcode scanning and integration build Build orders 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.

[FR] Scan in multiple stock items to a location

3 participants