CORE-POS / IS4C

Cooperative Operational Retail Environment
http://www.core-pos.com
GNU General Public License v2.0
64 stars 44 forks source link

Ignore "orphaned" SKU when saving product #1068

Closed lgedgar closed 3 years ago

lgedgar commented 3 years ago

assuming the following:

with this commit, user is allowed to edit 1st item and assign it SKU 12345, even though that is associated with a different UPC. since there is not a corresponding products record, the vendorItems record is considered "orphaned"

without this commit, user is not allowed to assign SKU to 1st item, b/c of the orphaned vendorItems record.

the code change basically ignores orphaned records, so they do not prevent user from taking desired action in this particular case.

This also relates to https://github.com/CORE-POS/IS4C/commit/e3eef017dbbcc8fae21568674ab2023267387f2d and https://github.com/CORE-POS/IS4C/commit/b1a1a4d49279d560ab8281794407e31bca3c8ff1

gohanman commented 3 years ago

I feel like this just duplicates 18f13387c7c9d94e95b36f077749997c35dc8ee5 but makes it more of a footgun since the user isn't aware of the underlying issue. A simple typo seems like the most plausible source of problems. In a bigger catalog you could miss one digit and hit a different, valid SKU in the catalog.

lgedgar commented 3 years ago

Ha yep that's a nice easter egg you have there. ;) I agree and happy to close this with no merge.