Open rco3 opened 4 years ago
Interesting concept. It's not something that Django supports per se, but it would be reasonably easy to handle on the front-end using javascript.
Essentially, setup some sort of key-press sequence event listener which responds to something that looks like barcode data, silently send that data to the server via AJAX, and wait for a response.
If the server recognizes the barcode data it can send back an instruction to the javascript function running in the browser, with an action to perform.
For example, jump to the page displaying the item that has just been scanned.
Yes, exactly that. Or, depending upon perhaps which page is currently active, might default to other action upon the entity whose barcode was just scanned, e.g. counting or transferring or something. I imagine a small kiosk with a scanner, walk a part label up to it and scan it and it's automatically placed in a queue for re-supply, that kind of thing.
Take a look at this jQuery module, it works well, you can configure it to detect the prefix keystrokes from your wedge and then act on the key data it receives after that:
https://github.com/julien-maurel/jQuery-Scanner-Detection
I have used it in opencart to automatically take you to the order details page after scanning a barcode that is either on the box or the shipping manifest.
@SchrodingersGat is this something we should implement?
I'd be open to it, but don't have time or desire to implement it myself. Looks like the jquery-scanner-detection library is outdated, might want to use https://github.com/axenox/onscan.js instead
@SchrodingersGat should we tag this for hacktoberfest
?
Done!
PartKeepr did this neat thing: you could assign a key combination that caused the following text to be piped directly into the barcode decoding module. If your wedge was fancy enough, you could assign that key combo as a prefix and a CR/LF as the suffix and simply scan a barcode into any page without focusing on a text entry field. Open webpage, scan barcode, StockItem appears.
Is this the sort of thing that Django inherently supports, such that this is a super-simple "hey, great idea!" kind of feature suggestion, or more of a "No, we would have to re-write Django ground-up, take a hike," kind of thing?