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

Add functionality and links to stock movement page #3666

Closed
3 tasks done
seand7565 opened this issue Jun 14, 2020 · 4 comments
Closed
3 tasks done

Add functionality and links to stock movement page #3666

seand7565 opened this issue Jun 14, 2020 · 4 comments

Comments

@seand7565
Copy link
Contributor

seand7565 commented Jun 14, 2020

Is your feature request related to a problem? Please describe.
As someone who has managed stock in the past, being able to see a detailed list of stock movements for any given product is essential. If I need to figure out why the website says we have 1,000 of a product but there are only 3 on the shelf, having a list of stock movements is key to figuring that out. This is something that Solidus already does, but it's not very useful or visible in its current state.

Describe the solution you'd like
There's this handy page that I don't think a lot of admin even know about: Stock locations stock movements. It's located at /admin/stock_locations/#{id}/stock_movements. It displays the stock movements for the location in a nice list that contains the order/refund the movement happened for, and how much stock was moved.

image

This is already pretty useful, but there are a few things we can do to improve it:

  • Add an originator for stock movements initiated by admin users. Admin stock movements currently have no originator, but it's useful to see who made the movement, so the originator in this case should just be the admin user who initiated it.
  • Add search functionality for variant.sku and originator so we can see stock movements for any given item or created by any admin user.
  • Add a link to this page from each stock_item on the product stock page, scoped to the variant ("See Recent Movements" or something, that page has limited space, so maybe just an icon would be better for the link)

With all this in place, I'd be able to go back through stock movements for a product to figure out why there's a discrepancy between what Solidus says we have on hand and what we actually have on hand - very useful as a stock manager!

@jacquesporveau
Copy link
Contributor

I've started to look into this.

I created a stock movement via the admin interface as described in the docs:
https://guides.solidus.io/developers/inventory/stock-movements.html

After that I noticed that the record created associated the user that made the stock movement correctly.

irb(main):005:0> Spree::StockMovement.last
  Spree::StockMovement Load (0.6ms)  SELECT "spree_stock_movements".* FROM "spree_stock_movements" ORDER BY "spree_stock_movements"."id" DESC LIMIT ?  [["LIMIT", 1]]
=> #<Spree::StockMovement id: 38, stock_item_id: 6, quantity: -1, action: nil, created_at: "2020-06-20 18:20:06", updated_at: "2020-06-20 18:20:06", originator_type: "Spree::User", originator_id: 1>

I think that the functionality for associated movements with the user that made them probably already exists but I noticed that nothing was being displayed on the stock movements admin page just like the screenshot you posted.

I am going to take a quick stab at just altering the UI to display a user email instead of nothing.

@seand7565
Copy link
Contributor Author

Ah, beautiful! If admin-created stock movements are already associated with a user, then there should just need to be an adjustment to the view to display them. Thanks for looking into this @jacquesporveau

@jacquesporveau
Copy link
Contributor

I've opened a PR for the first checkbox.

@kennyadsl
Copy link
Member

This one just needs the last checkbox:

Add a link to this page from each stock_item on the product stock page, scoped to the variant ("See Recent Movements" or something, that page has limited space, so maybe just an icon would be better for the link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants