-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add POReceiveBarcodeHandler to support barcode/po-receive/ endpoint #421
Add POReceiveBarcodeHandler to support barcode/po-receive/ endpoint #421
Conversation
Oh also, probably doesn't exactly belong here, but why did the minSDKVersion get bumped to Android 10 exactly? ^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@30350n this is really well implemented, very nicely done! Will compile and test myself in the next couple of days
2c26b28
to
8243299
Compare
Thanks a lot! I've been using it a bunch the last days, scanning through a box of old digikey parts and it's been working great for me! (Currently working on mouser and lcsc support for my part importer, so I can go through the rest of that box aswell ^^) I really like how the barcode scanner also just keeps being open, only annoying thing is that, atleast for me it still turns my phones screen of after 30s (in the camera app, it stays on forever I think, not sure if that's possible to implement here aswell). |
Worth looking into. I am sure there is a way to keep the screen on. |
As the app can be pointing to an older version of the server (which does not support this functionality) you will need to hide the scanning actions if the server API version is below a minimum version (as specified in your other PR). Check out |
0708ce4
to
6146ddc
Compare
Done! Bumped the API version to 135 in #5509 and added checks for it here :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@30350n the app side of the equation is working really well :) just one small change to the barcode overlay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Once the changes are made to the InvenTree code I'll merge this in :)
The "quantity" field is not an integer, and can cause the app to crash if not handled correctly
@30350n I had to make a slight tweak here, was crashing due to incompatible field types (int? vs double?) |
Ah yeah, thanks! I still think of quantity as an int somehow 😅 |
@30350n I saw this issue in the release notes and was really excited to try it out, but unfortunately cannot get it to work on my setup. Can you tell me the steps to execute to get this working? |
Sorry for the late answer. To make this work, you basically just need a placed purchase order containing various supplier parts. Then use the Can you describe how/why you "cannot get it to work on your setup"? |
Where do I find the |
It's in a few different places. You can use the Barcode Action from the Purchase Order Section, but then you'll have to specify the Location manually for each part you scan. If you don't want to do this, you can navigate to the Stock Location first (by scanning a barcode for example) and then use the If the App fails to match a purchase order from the barcode (there's been some recent improvements here which aren't released yet afaik), then you can also use the
Afaik you need 0.13 atleast. |
@30350n This is still not working for me. When I try to scan the 2d matrix on the digikey label, I get the "No match for barcode" notification. What am I doing wrong and how can I fix it? |
@HannesMorre are you certain that the InvenTree SKU matches the Digikey part number exactly? |
It would also make this much easier if you could provide a picture of the barcode you are trying to scan, as well as a screenshot of the Part page of the part you are trying to scan. |
Ok so this is a critical piece of information.
|
We have 2 devices to scan all kinds of barcodes:
We are scanning using the Inventree app on these android devices. |
@SchrodingersGat this feels kinda like some kind of space padding issue that occurs when using the wedge scanning mode.
Nvm, seems like past me already accounted for that. Could it be some non whitespace character? @HannesMorre Easiest way for us to debug this further would be if you'd change your Repeat this while scanning with the camera (which should be working if I understand correctly) and share both log sections here. |
I scanned with the hardware/wedge scanner first and then with the camera. These are the logs:
|
Okay, thanks for that.
So the issue here seems to be that when using the wedge scanner the barcode data is missing the unicode seperation characters ( @HannesMorre You've previously stated this:
and here those are also not included actually. Could this be an issue with the wedge scanner you are using? Maybe there's a setting enabled that supresses special characters or something like that? You could test this by using a third party barcode scanning app (I'm using this one for example, available on F-Droid) with the wedge scanner to scan the barcode. @SchrodingersGat I could also imagine it being an issue with the keyboard handling code here, particularily the very first early return check. |
Both barcode scanners are set to process the data as "keyboard event" and "key stroke". Could this be the cause of the problem? We also use these scanners with other apps where the keyboard event/key stroke setting is required. |
No, that's how these wedge scanners generally work. The problem is that they might or might not have a problem with handling unicode characters. That's why I'm asking you to test with a 3rd party barcode scanning app, that way we'd be able to tell if it's the scanner itself causing the problem, or the keyboard handling code in the inventree-app. If you are looking for possible scanner settings that'd be affecting this: Do they maybe have a charset/encoding setting? If so, make sure it's set to "unicode"/"utf-8". |
It would appear that the "keyboard listener" approach under flutter (at least on android) does not send through the special control characters are not recorded! I have a USB zebra scanner I am testing with. Scanning the barcode above, into a text editor on the PC, the correct control characters (0x1D, 0x1E) are inserted. However in the app, these characters are missing! Currently looking into why this is happening, and how to potentially fix.. No promising leads so far |
Okay, thanks for confirming that! I don't have any hardware scanners so it's hard for me to mess with this, looking at the code though, I noticed that the |
So if I understand correctly it could be a bug in the mobile app? When I can find the time I will download a third party scanner app to test the scanned data. |
@HannesMorre please do, any additional information would be helpful. For reference I was using the Zebra DS2208 scanner. |
@30350n I'll checkout HardwareKeyboard when I get a chance... |
Another remark on this: When we assign a customer P/N to certain parts on Mouser, only this part is included in the data matrix and not the Mouser SKU: Are there changes needed in code to fix this or do we need to change our way of working for this? (e.g. not assigning customer P/N on Mouser) Important note on this is that the customer P/N are assigned automatically by using the supplier panel plugin |
Yeah, that is kinda annoying and will probably not work with the current implementation. They do the same thing with custom order numbers, which I accounted for, but I never used custom part numbers myself, so I missed that one. |
Will this be implemented in any future update? |
This adds the barcode handler for scanning received parts, implementing the new api endpoint from inventree #5509.
There's 3 different places in which the barcode action gets added: