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

API driven table views don't include variant stock for template parts #935

Closed
bcc opened this issue Aug 26, 2020 · 3 comments · Fixed by #2806
Closed

API driven table views don't include variant stock for template parts #935

bcc opened this issue Aug 26, 2020 · 3 comments · Fixed by #2806
Assignees
Labels
enhancement This is an suggested enhancement or new feature stock Related to Stock models
Milestone

Comments

@bcc
Copy link
Contributor

bcc commented Aug 26, 2020

I've got 2 variations of the same part, from different manufacturers and while I need to track these separately I don't care about the stock levels of each type of part individually.

In this case, I have a template part "Widget", with variants "Acme Widget" and "OCP Widget". I have set a minimum stock level of 10 parts for the generic "Widget", and I have 6 of each. I have enough in total.

In the part view for "Widget" (/part/3/, for example) and the page reports the correct number:

Available Stock | 12
In Stock | 12

However, the API doesn't include variants in stock calculations unlike the core model, so the tables that render stock levels such as the "low stock" table on /index/ and under the generic /part/ url show "no stock" for this template item. I can see that you might not want to aggregate variants in the API (at least by default), but it would be nice if the stock level of variants was (optionally?) taken into account on these tables, and so that the numbers are consistent across the application.

@bcc
Copy link
Contributor Author

bcc commented Aug 26, 2020

Ah, there are also some issues counting serialized stock correctly. If I have 4 serialized "Acme Macguffin" in location "Area 51", with a minimum stock of 4, the /index/ low stock table reports it as 'low stock' and claims I only have 1 in stock.

@SchrodingersGat
Copy link
Member

Ben this is a fantastic bug report! Very nuanced understanding of what is going on here 👍

I agree that the API should be extended to (optionally) allow aggregation of stock for templated variants. Should not be too difficult and is a clean solution that should work across the board.

@SchrodingersGat SchrodingersGat self-assigned this Aug 27, 2020
@SchrodingersGat SchrodingersGat added enhancement This is an suggested enhancement or new feature stock Related to Stock models labels Aug 27, 2020
@SchrodingersGat
Copy link
Member

Ah, there are also some issues counting serialized stock correctly. If I have 4 serialized "Acme Macguffin" in location "Area 51", with a minimum stock of 4, the /index/ low stock table reports it as 'low stock' and claims I only have 1 in stock.

This one has now been fixed - #965

The other issues will require some further thought :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is an suggested enhancement or new feature stock Related to Stock models
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants