You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
apiRelates to the APIenhancementThis is an suggested enhancement or new featurehelp wantedAssistance requiredroadmapThis is a roadmap feature with no immediate plans for implementationstockRelated to Stock models
Please verify that this feature request has NOT been suggested before.
I checked and didn't find a similar feature request
Problem statement
It would be more user friendly if you were able to customize your stock status options. As an example I would like to use a status like "tested", "in production" or similar ones. The current status options are not enough for me to use them properly.
Suggested solution
Enable the option to create custom status options in the admin menu.
Describe alternatives you've considered
Extending the amount of predefined status options.
Hi there @Fluxus00!
The values for stock status are hard-coded and intertwined with the wider StatusCode system at the moment. It would be possible - from my POV - to decouple shown names from business logic by creating linked categories in the database. Those could have customizable names. There are some things to watch out for regarding API integration, migration path for existing users, translating and object lifecycle. It seems to be possible with a bit of work.
On my personal priority list, this is very low but if someone is interested I think we would be willing to give pointers, review and merge into core. If this is tackled, I would encourage the person doing so to migrate all StatusCode components as the additional work is probably comparatively small if you did it for one of the inheritors.
When I migrated to InvenTree a year back I had similar need as @Fluxus00 primarily because I have different reasons than what is hard coded to why stock should be treated as available and more important what should be included in overall inventory valuation and not. My first solution was to anyway use the status codes but with a note on my desk to translate between what I saw on the screen and the actual status.
This was obviously error prone why I now in my local installation have changed the hard coded values in the StockStatus class. It works well for my use cases, only little drawback is that the status codes are obviously not propagated the app.
I have seen FR's for the same being raised before why there is probably more people being interested. But as @matmair mention a proper solution comes with so much more and unfortunately I have not yet managed to build enough competence in the architecture to feel comfortable to volunteer for a full implementation. Maybe later this year when I have retired from my full time work...
Just a thought - given the complexity of the current status code, would a "tag" field with no business logic impact and with configurable values be an option?
@gunstr ping me or @SchrodingersGat here if you want some pointers how this could be done. There are many ways to achieve the requested functionality.
I will not provide a recommended way right now as the code base is moving somewhat fast and the references/names could change till you take a stab at it.
I think this makes sense to implement "fully" - make all stock status codes customizable by the user. This will give us more flexibility down the line too.
Thank you all for your replies! It seems like I was underestimating the amount of work my request would require.
@gunstr Actually I am very interested into your solution. At the moment I am not using the app, so this would not be a problem.
May be you would be so kind to share which values/ lines/ variables you changed? Until the official release it would definitely help me, and maybe also other users.
I would caution against forking and changing core code permanently. It will make regular updateing - which is very important in terms of security - a lot harder.
I joined this community recently - and after some Inventree testing, I also discovered the need for "special" locations that would not count towards the overall store . Now we solve this by marking the item as "LOST" but this means 2 steps when moving between locations : 1st step move, 2nd step mark as LOST ....:-) I'll try to "throw" funds into polar.sh ( unfortunately it's not only up to me:-) )
apiRelates to the APIenhancementThis is an suggested enhancement or new featurehelp wantedAssistance requiredroadmapThis is a roadmap feature with no immediate plans for implementationstockRelated to Stock models
Activity
matmair commentedon Feb 1, 2023
Hi there @Fluxus00!
The values for stock status are hard-coded and intertwined with the wider StatusCode system at the moment. It would be possible - from my POV - to decouple shown names from business logic by creating linked categories in the database. Those could have customizable names. There are some things to watch out for regarding API integration, migration path for existing users, translating and object lifecycle. It seems to be possible with a bit of work.
On my personal priority list, this is very low but if someone is interested I think we would be willing to give pointers, review and merge into core. If this is tackled, I would encourage the person doing so to migrate all StatusCode components as the additional work is probably comparatively small if you did it for one of the inheritors.
gunstr commentedon Feb 1, 2023
When I migrated to InvenTree a year back I had similar need as @Fluxus00 primarily because I have different reasons than what is hard coded to why stock should be treated as available and more important what should be included in overall inventory valuation and not. My first solution was to anyway use the status codes but with a note on my desk to translate between what I saw on the screen and the actual status.
This was obviously error prone why I now in my local installation have changed the hard coded values in the StockStatus class. It works well for my use cases, only little drawback is that the status codes are obviously not propagated the app.
I have seen FR's for the same being raised before why there is probably more people being interested. But as @matmair mention a proper solution comes with so much more and unfortunately I have not yet managed to build enough competence in the architecture to feel comfortable to volunteer for a full implementation. Maybe later this year when I have retired from my full time work...
Just a thought - given the complexity of the current status code, would a "tag" field with no business logic impact and with configurable values be an option?
matmair commentedon Feb 1, 2023
@gunstr ping me or @SchrodingersGat here if you want some pointers how this could be done. There are many ways to achieve the requested functionality.
I will not provide a recommended way right now as the code base is moving somewhat fast and the references/names could change till you take a stab at it.
SchrodingersGat commentedon Feb 1, 2023
Ref: #4253
SchrodingersGat commentedon Feb 1, 2023
I think this makes sense to implement "fully" - make all stock status codes customizable by the user. This will give us more flexibility down the line too.
Fluxus00 commentedon Feb 2, 2023
Thank you all for your replies! It seems like I was underestimating the amount of work my request would require.
@gunstr Actually I am very interested into your solution. At the moment I am not using the app, so this would not be a problem.
May be you would be so kind to share which values/ lines/ variables you changed? Until the official release it would definitely help me, and maybe also other users.
matmair commentedon Feb 2, 2023
I would caution against forking and changing core code permanently. It will make regular updateing - which is very important in terms of security - a lot harder.
14 remaining items
matmair commentedon Apr 23, 2024
I have a working backend implementation but I think I will need till 0.16.0 to get testing and UI done.
czkapitan2 commentedon Jun 3, 2024
I joined this community recently - and after some Inventree testing, I also discovered the need for "special" locations that would not count towards the overall store . Now we solve this by marking the item as "LOST" but this means 2 steps when moving between locations : 1st step move, 2nd step mark as LOST ....:-) I'll try to "throw" funds into polar.sh ( unfortunately it's not only up to me:-) )
wolflu05 commentedon Jul 17, 2024
@matmair May I ask what the current status is with this? Do you think this will make it into 0.16? Is there anything you need help with?
matmair commentedon Aug 5, 2024
I think I can file a PR for this tonight; I am still searching for some inefficient lookups but that would be solveable
SchrodingersGat commentedon Aug 21, 2024
Thank you @matmair for contributing to close this issue! ⭐
The rewards from this issue, totaling $100, has been shared with you.
What now?
If you already have a Polar account setup, you don't need to do anything.