Open iamronakgupta opened 1 month ago
I believe the appropriate place to make the change for the order of items for the inventory adjustments is the adjustments controller, not the storage location controller.
There is code there that appears to be alphabetizing the items -- but I believe it is not alphabetizing them by item name, so it ends up being in the order they were added.
Please also provide tests for your changes.
@cielf Thank you for the review.
After checking from logs, I find out that when we changes storage location from drop down, there is an ajax call happens GET /storage_locations/3/inventory.json?include_omitted_items=true
which calls inventory action from storage_locations_controller and that's where items changes their order.
So I think the issue is in storage_locations_controller and specifically in inventory action.
Whats your thought?
Reference
@dorner yes I am working on this.
Just to confirm, I am working on storage_location_requests_spec here
Am I working at right place?
@iamronakgupta I fear that you are "barking up the wrong tree" -- working to solve the problem in the wrong place.
For clarity, here is the result when I manually tested it just now. You can see that the items dropdown in the Inventory Adjustments screen is not showing the items in alphabetical order.
The changes you have made so far would affect a different screen -- the storage locations view.
@iamronakgupta I fear that you are "barking up the wrong tree" -- working to solve the problem in the wrong place.
For clarity, here is the result when I manually tested it just now. You can see that the items dropdown in the Inventory Adjustments screen is not showing the items in alphabetical order.
![]()
The changes you have made so far would affect a different screen -- the storage locations view.
@cielf I think this is working because order and sort_by method puts words with lowercase at the bottom and uppercase at top
Yup. Looks like that is what it is doing, And it's what it was doing.
IMO, it should be a case insensitive sort because humans sort case insensitively - but that would currently make it inconsistent with the rest of the system.
Yup. Looks like that is what it is doing, And it's what it was doing.
IMO, it should be a case insensitive sort because humans sort case insensitively - but that would currently make it inconsistent with the rest of the system.
@cielf So, how should I implement it? with case sensitive or insensitive?
With case sensitive. We'd want to make all the sorts case insensitive at the same time.
Resolves #4219