Repository navigation
Description
Please verify that this feature request has NOT been suggested before.
- I checked and didn't find a similar feature request
Problem statement
When creating a build order to assemble parts with purchase cost data, the cost of the assembled output is not the sum of the cost of the parts. Instead a BOM range is used in the "stock value" for the output. This does not allow accurate tracking of the value of inventory we have, which fundamentally breaks the ability to use InvenTree as part of the accounting side of inventory management.
Here is a simple example to show how this can cause significant errors in the calculated "stock value" versions the actual value in stock:
Let’s say we just have two parts:
- C1: is a component that we purchase from a vendor
- A1: is an assembly that is just composed of one C1
Purchase 10x C1 at $10 each - We have paid $100 and our stock value accurately reflects this at $100
Build 5x A1s - We now have 5x C1s and 5x A1s and our stock value accurately reflects our overall inventory of $100
Buy another C1 at $100 (say we needed a part real fast, so high cost) - Now we have $200 in inventory
- The original 5 C1s that remain are still priced at $10 each ($50 total)
- The new 1 C1 is priced at $100 ($100 total)
- However, the A1s we built from the $10 C1s no longer say they are just $10 each, instead their stock value is listed as $10-$100 each.
So our overall inventory is: - $50 from original C1s
- $100 from new C1
- $50-$500 from old A1s
Total: $200-$650
With this very simple example you could just say take the low end, but that doesn’t work in more complex examples. Using stock item pricing age can help in some cases, but not others.
My company would likely be willing to support some of this development since right now this is creating significant overhead in accounting for what the value of our stock is.
Suggested solution
When build outputs are created from a build order, the cost of the assembled stock items should be the sum of all the stock items used.
Describe alternatives you've considered
Using "Stock Item Pricing Age" can help in some cases, but does not work well overall to solve this problem since some parts we have get turned over quickly, while others only transition slowly and can have significant cost changes.
It makes sense that when looking at a part that the BOM price range will used to give a sense of the overall price of making a part. However, when a build order is completed the newly built part has a very specific cost based on the exact cost of the stock that was allocated to build the new part.
Right now the solution involves either a lot of additional spreadsheets or we have to manually assign costs to assemblies.
Examples of other systems
No response
Do you want to develop this?
- I want to develop this.
Activity
LavissaWoW commentedon May 26, 2024
I've been meeting similar questions from my own management.
I do think the pre-requisites are present for this to be easy to implement.
Sure, InvenTree isn't an accounting tool. And half-assing one is worse than not having one.
But I do agree that it wouldn't be a bad idea to populate the
purchase_pricefield for a build Output, basing the cost on the actual costs of the stock items used.Doing this will also yield more accurate tracking of increasing production costs, as the price range of a given part will be based on the actual production cost, not just the projected future cost.
SchrodingersGat commentedon May 27, 2024
@cjdet your suggestion is a good one. There is another similar issue floating around which raises the same idea, however I can't find it right now (the curse of having > 200 open issues and only a handful of active developers).
I have been pondering on this one, I think it calls for an extension of the existing pricing system:
Further ideas / discussions welcome. One additional consideration is for things like labour costs, and additional "costs to build" which are not part of the Bill of Materials
cjdet commentedon May 27, 2024
Thanks for the consideration and feedback. I searched a whole bunch of FRs and Bugs and didn't find anything along these lines, but I'm sure there are other related ones. Here are some additional thoughts:
While InvenTree certainly isn't an accounting system, it is tightly tied to accounting since at least in the US you can't deduct cost of goods sold until the inventory goes out the door. So knowing how much the parts of an assembly you just sold cost is very important. Regardless, InvenTree has really streamlined out inventory management and build proces, thanks!
SchrodingersGat commentedon May 27, 2024
@cjdet given the vast quantity of outstanding issues, this concept (while important, and I support it) is getting added to a very big pile of things to do.. Our development team is very under resourced unfortunately.
If your comapny is willing to fund this issue, or even contribute code I'd be happy to discuss further!
matmair commentedon May 27, 2024
I expect whoever adds this functionality to commit to maintaining it, I guarantee I will neither handle bug reports, fixes, reviews or code quality for it.
And I expect the person to write documentation that ensures InvenTree is not mistaken for an accounting system, driving some small businesses into the ground come tax time.
cjdet commentedon May 29, 2024
@SchrodingersGat we would certainly be willing to talk about funding this or contributing code. Would you be open to just propagating purchase_price into the purchase_price of the assembly? If so that could be a straightforward PR that we could probably do. If it is revamping to add unit_cost, that would require a lot more in-depth knowledge.
gunstr commentedon Oct 21, 2025
As the concept with "Internal Price" is already implemented I would suggest to use that as "Unit Price" for new stock items created as build output, that would solve the stock valuation issue discussed above.
It will require manual work to set and maintain the "Internal Price" but I do not really think there is a way around that. In my production environment I have actually taken that one step further - the "Internal Price" is manually maintained for most parts, not only assemblies but also purchased parts. That comes with the advantage that the calculated BoM prices for assemblies are always relevant.
This method works very well and the only feature I'm missing is to have InvenTree to pick the Internal Price (if it exists) for an assembly and automatically use that as the Unit Price for each new stock item created as build output.
SchrodingersGat commentedon Oct 21, 2025
The key issue here is that the "internal price" is actually a "range" of prices. So, which price do you actually pick?
Also, note that the actual "cost" of the component parts used in the assembly may be different - if each part was purchased separately, or itself had a different cost of manufacture, then there's not a clear single value to pick here.
If we can come up with a good solution here, I'd like to implement this soon
gunstr commentedon Oct 21, 2025
There is a lot of flexibility built into InvenTree but for the internal price I do not see a usecase for a range why I always set the price for qty 1. When using the internal price for stock valuation it has to be a fixed value irrespective of volume.
I take care of that by also maintaining the "Internal Price" for purchased parts. For cheap "commodity" type of components the price is reviewed and uppdated one or two times per year while the most expensive parts are being reviewed for every PO. As there is an "Internal Price" for each part the BoM cost calculated by InvenTree can be used directly as input when it's time to update the Internal Price for assemblies. The BoM cost will vary over time but only as a consequence of updates of the Internal Price for sub components. This could potentially be automated but I actually prefer to do a quick review before updating the Internal price, normally the sales prices are also updated at the same time.
It's a bit difficult to find a good trigger for when to Review/update the Internal Price for asseblies but typically that is done before large build orders are opened or when the Internal Price is changed for more expensive parts (the "Used In" analysis comes in handy for that).
Until now I have not realized that the "Purchase price" can be set also for asssembly atok items and is used as Unit Price, As we have discussed it now I tested to do that manually for last weeks build output and it looks really promising. If the Internal Price for the part could be mapped automatically to the stock item(s) when build output is created I would be super happy. And as you suggested in #10625 mabye rename the "Purchase price" field for stock items to "Unit price" to avoid confusion.
SchrodingersGat commentedon Oct 21, 2025
For your application it sounds like you have a simplified solution and are happy with a significant amount of manual data entry - however many users will have large datasets with a complex purchasing history where the cost range of any given part is substantial. Extend this to dozens of line items in a BOM and it gets complicated!
I think that the solution here looks like:
gunstr commentedon Oct 22, 2025
A few experiences from working in a large company with hundred of thousands different part to maintain are:
This is the kind of general principles I have scaled down to the smaller dataset (currently ~1k parts) I use InvenTree for now and I think your suggestion sounds very reasonable. As I see it all basic functionality is already there in InvenTree, it's more about using it in a proper way and possibly add plugins to support or automate certain tasks. I have not looked into it, but I guess setting the "Unit Price" = "Part Internal Price" for build outputs should already now be possible to implement as a plugin - correct? It would probably also be possible to raise a flag if there is no internal price set - or if there is more than one as that is not allowed in my case.
Irrespective of different decisions on update strategies I see maintaining the "Internal Price" field for Parts and "Unit Price" field for stock items as the core to keep stability and consistency wrt. pricing.
Looking at @cjdet original problem description in this issue the decision on how to handle the corner case with one single component having an extremely high peak cost I beleive will always require a manual decision how to handle.
matmair commentedon Feb 12, 2026
@SchrodingersGat I feel like this might be an important one when / if we ever get to the pricing refactor
SchrodingersGat commentedon Feb 13, 2026
Agreed, it is on my radar too
PTrUNB commentedon Aug 10, 2026
Currently price max.1 and min.0 are available in reports.
Could we get a BOM price based on primary supplier as a work around ?