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
Fix reassigning supplier barcodes #6162
Fix reassigning supplier barcodes #6162
Conversation
✅ Deploy Preview for inventree-web-pui-preview canceled.
|
@30350n thanks for the fix to address this - I think that your approach here is good. I'm not sure based on your comments above if you have any more work to do, or happy for me to merge in? |
Sure, if you don't see any obvious problem with that approach too, then it should be good to go ^^ |
If you can fix the conflicting files I will merge! |
Done! (urgh, single quotes ...) |
Uhhh, now pre-commit is complaining about stuff I didn't even touch. Guess that's no bueno? |
We just merged in some changes to our style checks which are now a bit more strict. It looks like only a few adjustments needed? |
Well I already fixed up all the code this PR touches like I said. Anything else shouldn't be part of it. |
Once #6203 is merged you should be able to simply merge master back into this PR and then it will pass |
Perfect, that seemed to work, thank you! |
Thanks @30350n :) |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
* Ignore 3rd party barcode plugins when assigning barcode * Use single quotes
Because of the way the current
BarcodeAssign
view is implemented, it's not possible to reassign 3rd party supplier barcodes anymore, if they get successfully matched.To mitigate this there's two possible approaches:
1. Only check the internal InvenTreeBarcode plugin in
BarcodeAssign
I can't really think of a reason why any barcode recognized by a 3rd party plugin shouldn't be able to be reassigned to an InvenTree object. The only problematic case is the same barcode data being directly assigned to 2 different objects (which is something only the internal barcode plugin should be able to do I'd guess?).
(This is what I commited here).
2. Add some kind of marker to
SupplierBarcode
plugins so they can get ignored inBarcodeAssign
I guess the simplest form of this would just be getting all of them via
registry.with_mixin('supplierbarcode')
.Note: Looking at the code again I guess this would also fix itself if the supplier barcode plugins wouldn't be builtin ...