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

Fix reassigning supplier barcodes #6162

Merged

Conversation

30350n
Copy link
Contributor

@30350n 30350n commented Jan 6, 2024

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 in BarcodeAssign

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 ...

Copy link

netlify bot commented Jan 6, 2024

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit c090745
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/659ffc80b42dbe000882632d

@SchrodingersGat SchrodingersGat added bug Identifies a bug which needs to be addressed barcode Barcode scanning and integration backport Apply this label to a PR to enable auto-backport action backport-to-0.13.x labels Jan 10, 2024
@SchrodingersGat SchrodingersGat added this to the 0.14.0 milestone Jan 10, 2024
@SchrodingersGat
Copy link
Member

@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?

@30350n
Copy link
Contributor Author

30350n commented Jan 10, 2024

Sure, if you don't see any obvious problem with that approach too, then it should be good to go ^^

@SchrodingersGat
Copy link
Member

If you can fix the conflicting files I will merge!

@30350n
Copy link
Contributor Author

30350n commented Jan 11, 2024

Done! (urgh, single quotes ...)

@30350n
Copy link
Contributor Author

30350n commented Jan 11, 2024

Uhhh, now pre-commit is complaining about stuff I didn't even touch. Guess that's no bueno?

@SchrodingersGat
Copy link
Member

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?

@30350n
Copy link
Contributor Author

30350n commented Jan 11, 2024

Well I already fixed up all the code this PR touches like I said. Anything else shouldn't be part of it.

@SchrodingersGat
Copy link
Member

Once #6203 is merged you should be able to simply merge master back into this PR and then it will pass

@30350n
Copy link
Contributor Author

30350n commented Jan 11, 2024

Perfect, that seemed to work, thank you!

@SchrodingersGat SchrodingersGat merged commit 082b5d1 into inventree:master Jan 11, 2024
24 checks passed
@SchrodingersGat
Copy link
Member

Thanks @30350n :)

Copy link
Contributor

💔 All backports failed

Status Branch Result
0.13.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

backport --pr 6162

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

30350n added a commit to 30350n/InvenTree that referenced this pull request Jan 14, 2024
* Ignore 3rd party barcode plugins when assigning barcode

* Use single quotes
@30350n 30350n mentioned this pull request Jan 14, 2024
SchrodingersGat pushed a commit that referenced this pull request Jan 14, 2024
* Ignore 3rd party barcode plugins when assigning barcode

* Use single quotes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Apply this label to a PR to enable auto-backport action barcode Barcode scanning and integration bug Identifies a bug which needs to be addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants