Skip to content
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

UniqueBarcodeHandler is broken due to supplier item matching #574

Closed
ius opened this issue Dec 11, 2024 · 3 comments · Fixed by #577
Closed

UniqueBarcodeHandler is broken due to supplier item matching #574

ius opened this issue Dec 11, 2024 · 3 comments · Fixed by #577

Comments

@ius
Copy link

ius commented Dec 11, 2024

Logic for assigning custom barcodes uses UniqueBarcodeHandler prior to actually linking the barcode to check whether a barcode is already in use.

var handler = UniqueBarcodeHandler((String barcode) {
InvenTreeAPI().linkBarcode({
model: pk.toString(),
"barcode": barcode,
}).then((bool result) {
showSnackIcon(
result ? L10().barcodeAssigned : L10().barcodeNotAssigned,
success: result
);
state.refresh(context);
});
});
scanBarcode(context, handler: handler);

This uses the /api/barcode/ endpoint which may in fact also return results due to the barcode being parsed and having an existing supplier item returned instead of the barcode actually being in use.

To reproduce: make sure a supplier item exists for a EIGP 114.2018 barcode (e.g. DigiKey/Mouser) then attempt to assign the barcode to a stock item.

I think this bug might be the cause of inventree/InvenTree#7637

Additional information
App version: 0.17.0 (built from source + patched for #570)
Flutter: 3.24.5

@SchrodingersGat
Copy link
Member

@ius nice catch - can you look into providing a patch for this?

@SchrodingersGat
Copy link
Member

SchrodingersGat commented Dec 13, 2024

@ius I should have a fix a part of #577 - can you please test on your end and see if the issue is actually fixed?

@ius
Copy link
Author

ius commented Dec 16, 2024

Was finally able to test this - works great! Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants