[FR] Split Received StockItems into "Packs of n pieces" (in Purchase Orders)
Please verify that this feature request has NOT been suggested before.
- [X] I checked and didn't find a similar feature request
Problem statement
Often I receive a quantity of an article as stock from a Purchase Order that come in individually packaged boxes or bags - like for example
- 10 power supplies in individual boxes (ordered were: 10x of the part)
- 6 canisters of liquid of 5L each (ordered were: 30L of the part)
These will go onto the warehouse shelf as individual StockItems (like one single power supply, on canister of 5L, etc) and get QR-code labeled as such, each.
For this I currently need to either
- receive the items one by one in the purchase order
or
- receive the items as one StockItem and Transfer sub-quantities out from that - one by one - to split the StockItem accordingly.
Both is pretty slow and repetitive, obviously.
Suggested solution
If we had a "split"-operation in the Received Items StockItem Table where one could enter the pack quantity that the items shall be devided into, that would be super useful.
I guess this would also benefit to other users than me as well..?
Describe alternatives you've considered
Thought about a plugin solution for this, but I would need to recreate a lot of UI (rendering another StockItem table in a custom plugin panel for example) to do that...
Examples of other systems
No response
Do you want to develop this?
- [ ] I want to develop this.
This has been requested before, still have not arrived at a "good" solution
- https://github.com/inventree/InvenTree/issues/2624
- https://github.com/inventree/InvenTree/issues/
One option may be to create a "supplier bundle" (which contains the listed parts, much like an asembly has a bill of materials), receive that, and then provide an option to "break out" the sub-items?
I think these are different features - the issue your are mentioning seem to have settled to „disassembly“ of assemblies/bundles that can consist of different parts.
My request would be basically the opposite of the „merge“ function, to split/divide a bigger StockItem into several smaller StockItems (of quantity n).
Implementation wise it could be just a repetitive „transfer“ operation until the quantity of the source StockItem is lower or equal to n.
This issue seems stale. Please react to show this is still important.
Not stale
Coming back to this to review against the platform UI, I'd like to propose a pretty simple implementation for this:
What if we extend the /stock/transfer/ API endpoint, adding a new parameter like split_into for the max number of parts per stock item.
I think it could fit very well into the API side, just adding one additional argument to StockItem.move() to drive a looped execution of self.splitStock().
https://github.com/inventree/InvenTree/blob/fb9c117e374443500000845d271d8deabc5ee47f/src/backend/InvenTree/stock/models.py#L2032
On the UI side that could be just an additional column in the "transfer stock" modal table - or it could be its own new action as "split stock", which would be more explicit to a new user I guess.
@simonkuehling are you suggesting that in the "transfer" function, if you are moving a quantity of 100x units, you can specify "split into" quantity (e.g. 5) which would create 20 new stock items each of quantity 5?
@SchrodingersGat I totally missed your last question here - yes, that is exactly what I have in mind!
@SchrodingersGat since this is still a very relevant missing feature for us, I would give it a try coding this. Do you agree that the proposed implementation is worth trying for this?
To recap:
- adding one additional argument to StockItem.move() to drive a looped execution of self.splitStock() https://github.com/inventree/InvenTree/blob/d137728e604b5db41655dfc59040c5cf1d9d0d63/src/backend/InvenTree/stock/models.py#L2216
- adding that new parameter to the /stock/transfer/ API endpoint
- add "split" action to the stockitem UI menu with a "maximum number of items per stock item" input
I think overloading the "move" function here is not the best approach. It creates a confusing addition for general purpose moving actions which I think will not appeal to most users.
I would suggest an alternative. On a purchase order where you are receiving items into stock with a specified "pack size", then in the "receive items" form, add a "split into packs" option.
Let's say you have a part which is an "M5 bolt". You purchase these from a supplier in boxes of 100. You order 5x boxes from the supplier.
Current Approach
You receive 5x boxes into stock - it creates a single StockItem entry of quantity 500. Not what you want here.
Alternative Approach
When receiving the items against the purchase order, you check the "split into packs" option. This creates 5x separate stock items, each with quantity 100x bolts.
Thoughts on this approach?
Well, I do like the simplicity of your approach, and it would definitely solve the problem for all supplier parts with known pack sizes in a very tidy way - but it would not be sufficiently flexible in many of the cases we see in daily operations unfortunately.
The problem is that for certain products the actual pack size isn't known beforehand - for example when ordering liquids or granulate materials by volume (e.g. liters) or weight (g/kg). We see this commonly with chemical supplies (solvents like acetone, alcohol) and composite resins, fillers etc. Also with cut-tape SMD components they can come in packs like for example 1000+1000+1000+300 when ordering an odd number like 3300pcs.
Maybe we could add a new method split_into_packs() that contains the logic and just uses the singular move() operation as it is...?