-
-
Notifications
You must be signed in to change notification settings - Fork 572
Resolves #4771 add unicity on low inventory query items returned #4782
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
Resolves #4771 add unicity on low inventory query items returned #4782
Conversation
cielf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from a functional pov. Over to @dorner for any technical comments
dorner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think adding a .uniq to Inventory.all_items is probably a better approach since this might be happening in other places.
|
I tried this out and ran the specs. It looks as though the intended functionality of I know you said that this could be happening elsewhere unintentionally, but because the spec is so explicit, it feels like this is used intentionally elsewhere in the app. Just for reference, here are the failures : |
|
Ah yep, you're right. These aren't actually "items" but essentially inventory items. Technically you can rework this by referencing the item itself and |
|
Ah I see. Ok thanks 👍 |
|
@nikolaz90: Your PR |
Resolves #4771
Description
This should fix repeated rows on the dashboard low inventory report.
This seems like the least drastic change to the LowInventoryQuery, though I was considering another approach with
Item.where(...)but that would seem like rewriting a lot of the logic that already exists inView::InventoryandInventoryAggregateType of change
How Has This Been Tested?
This adds a couple of cases to the
low_inventory_query_spec.rbfile testing the length and contents of aLowInventoryQuery.call()when an Item is edited in two differentstorage_locations.Screenshots
Before :

After :
