Repository navigation
Description
Please verify that this bug has NOT been raised before.
- I checked and didn't find a similar issue
Describe the bug*
With ref. to #10599 I open this issue as I belevie there is a bug that needs attention as it seems that the displayed currency is not always reflecting the settings.
Steps to Reproduce
I used the Demo site to illustrate the issue:
- Set the base currency to EUR (€) in the Admin Center
- Open the Part Pricing tab for Part: 002.01-PCBA | Widget Board (assembled) | REV-A
- The Pricing overview is displayed in GBP (£)
- The BoM pricing is displayed in GBP (£)
- Open the Stock tab for the same Part
- The Stock Value column is dispalayed in USD ($)
- Open the BoM tab for the same part, here the prices are in the default currency EUR (€)
Expected behaviour
As the actual values are the same I beleive all views above should display the prices in the configured default currency.
As mentioned in #10599 I see an even more strange behaivior in my production setup as I can see different currencies for items in the stock table. Could be related but let's focus on the demo site for now.
Deployment Method
None
Version Information
InvenTree-Version: 1.1.0 dev
Django Version: 4.2.25
Commit Hash: 3b27d56
Commit Date: 2025-10-19
Commit Branch: null
Database: django.db.backends.postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-5.15.0-100-generic-x86_64-with-glibc2.41
Installer: DOC
Active plugins: false
Try to reproduce on the demo site
I tried to reproduce
Is the bug reproducible on the demo site?
Reproducible
Activity
SchrodingersGat commentedon Oct 19, 2025
The pricing is not updated immediately across the entire database. If you change the default currency, then any future pricing calculations will use that.
Pricing Overview
When it gets updated next, it will use the base currency. You can hit the "Update Pricing" button to force a refresh for a given part.
Stock Items
If stock items have an associated purchase price, that is displayed in whatever currency it was initially recorded as. This does not change when you change the base currency
gunstr commentedon Oct 20, 2025
OK, that explains the Currencies in the pricing overview - I tried now to hit the "Refresh Pricing" button on the Demo site and it all got updated to the new currency as you describe.
But I still have an issue then that I have to find a way to recreate on the Demo site. For the latest build orders (probably after the upgrade to 1.0) the created stock items get USD as currency although my Base currency is (and always has been) SEK. And more problematic is that the actual numeric value is the same (2,012) as you can see here:
If I open the details view on of one of the stock items and hit "Edit" I can see that the "Purchase Price" is set to USD. I guess that is from where the currency is picked although its an assembly that is not purchased.
I will try to recreate on the Demo site and report back.
gunstr commentedon Oct 20, 2025
I think I found what is causing the issue. To reproduce on the Demo site:
I think this boils down to two things:
A related thing that came to my mind when looking into this and maybe more of a Feature Request - would it not make sense to freeze a Unit value for build outputs at the time of creation? As I understand it the current implementation will always pick the latest part price as value for any build output stock items. But as the BoM price can change over time a more relevant value of an assembly is the price when it was created in the same way as the price is frosen for purchased stock items. I checked with the accounting team and they confirm this is how they would like to see the stock valuation. What is your view on this?
SchrodingersGat commentedon Oct 20, 2025
@gunstr thanks for the careful analysis here.
A PR for part of this is open here - #10641 - the "default currency" was not properly observed in the stock item forms.
Yes, this is a good idea and has been requested multiple times - including #7279
The simplest approach here is to use the "purchase price" field on the stock item as a more generic "unit price" field - which can be filled out from multiple possible sources:
There are a few complications in how best to actually implement this, which is why it has not yet been done.
The biggest road block at the moment is that there is no easy way to calculate a single "cost price" from a build. At best, we get a lot of price-range values for each of the consumed parts.
Any thoughts on this are appreciated - I've been wanting to implement this for a while.
gunstr commentedon Oct 20, 2025
@SchrodingersGat Thanks a lot for the quick fix to the Currency issue. I have manually now gone through the output from all recent build orders and changed the "Purchace currency" to SEK and at least what I have seen so far it looks all good and did not generate any new issues.
Regarding the Unit value for build output I think the discussion in #7279 captures the problem well. I realized quite early when I moved over to InvenTree that the "range of purchase prices" will over time become quite irrelevant and thus unusable.
I try to summarize the solution I have used to overcome this below:
As the "Internal Pricing" overrides the range of purchase prices I always set and maintain an "Internal price" for each part in the database in order to get a relevant BoM price for assemblies. I look at the recent purchase orders and the Unit Prices of the current stock (which is the actual purchase price) and then decide on a relevant "internal price".
With the "Internal Price" set there is also one single calculated BoM price that is used to set the "Internal price" for assemblies . The "single" prices method propagates upwards in case of multiple levels of assemblies.
One option to implement support for such a methodology in InvenTree could be a "strict mode" for pricing that comes with a requirement to always have the internal price set for each part - then the current Internal price for a part could be used to automatically populate the Unit price for build outputs at the time of creation.
Automation is good, but I belive some manual work is necessary to maintain prices/costs in a relevant way. I used to work for a very large company before and a similar method for Internal prices was used there also, althoug on a much bigger scale.