feat(barcode): continuous multi-scan mode + build-order scan-to-allocate#11682
feat(barcode): continuous multi-scan mode + build-order scan-to-allocate#11682verysleepylemon wants to merge 2 commits intoinventree:masterfrom
Conversation
❌ Deploy Preview for inventree-web-pui-preview failed.
|
|
|
||
| // --------------------------------------------------------------------------- | ||
| // Scan-to-allocate: scan a stock item barcode to directly allocate it to | ||
| // this build order. Resolves: https://github.com/inventree/InvenTree/issues/11278 |
There was a problem hiding this comment.
Please remove the GH issue reference from the code here
|
@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
Please move the "Scan to allocate" button into the "barcode actions" menu to avoid cluttering. Stay Open ButtonPlease change this checkbox to a
Much like we already do for the "keep form open" switch:
Clear Log ButtonTo accommodate the change as above, move the "Clear log" button back up into the modal content:
Error HandlingIt appears that the current implementation is not fully functional - see error code below:
|
| ); | ||
|
|
||
| try { | ||
| await api.post(apiUrl(ApiEndpoints.build_order_allocate, build.pk), { |
There was a problem hiding this comment.
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), { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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` | ||
| }; | ||
| } | ||
|
|
There was a problem hiding this comment.
You will need to handle the case where more than one line item is returned (ambiguous)?





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