inventree / InvenTree

Open Source Inventory Management System
https://docs.inventree.org
MIT License
4.08k stars 727 forks source link

Unassigned barcode opens supplier item #7690

Open SchrodingersGat opened 1 month ago

SchrodingersGat commented 1 month ago

Discussed in https://github.com/inventree/InvenTree/discussions/7646

Originally posted by **dieselburner** July 14, 2024 I have faced rather weird issue and don't know how to fix this. I received my order from Mouser and while scanning received items one by one I have found out some of these gives error about "existing barcode". Surprisingly, scanning barcodes on these few problematic items via Android opens "supplier item", and it's the correct one. I checked the database records, and these supplier items does not have barcode fields set. So... I assume the system somehow checks the barcode, even if it's not assigned to anything yet, and if it corresponds to supplier item, just reports with error it's already in the system. I of course can generate my own barcode label to these received items with misbehaving barcodes, but curious if this barcode supplier check can somehow be turned off? Just to avoid unnecessary questions: the behavior is the same if I configure Mouser barcode plugin to point to Mouser supplier, or not. Thanks.
SchrodingersGat commented 1 month ago

@30350n do you have any input / insight on this one? This probably is related to the extensive supplier barcode support you added

30350n commented 1 month ago

That largely sounds like expected behavior. Barcode plugins should not be checked when trying to assign a barcode though. This was adressed by me in #6162.

So either that got messed up, or @dieselburner actually already (unknowingly) assigned the barcode in question (for example via the Scan Received Items functionality).

SchrodingersGat commented 1 month ago

@dieselburner please refer to the comments by @30350n above - any chance it could be a workflow issue?

dieselburner commented 1 month ago

@30350n Nope, I believe I didn't messed up, since this was a fresh delivery of components, which were never scanned before. This might be related to the issue I posted earlier: https://github.com/inventree/InvenTree/issues/7637 Also, as I wrote:

I checked the database records, and these supplier items does not have barcode fields set.

30350n commented 1 month ago

If you use the Scan Received Items functionality, the scanned barcode will be automatically assigned to the created stock item.

I also checked again and the code from #6162 is still intact.

dieselburner commented 1 month ago

@30350n, don't trying to be impolite, but did you went through the issue which I mentioned?

30350n commented 1 month ago

Yeah, looks like you are scanning two different barcodes. If you look at the actual barcode data, it doesn't match at all.

dieselburner commented 1 month ago

Yes, the logs I provided are around two different barcodes, which doesn't exist in the database.

matmair commented 1 month ago

There is more technical info at https://github.com/inventree/InvenTree/issues/7637 so I think it would be good to address #7637 before checking if this one is still relevant