Skip to content

Mixed up currencies #10625

Closed
Closed

Description

@gunstr

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:

  1. Set the base currency to EUR (€) in the Admin Center
Image
  1. Open the Part Pricing tab for Part: 002.01-PCBA | Widget Board (assembled) | REV-A
  2. The Pricing overview is displayed in GBP (£)
Image
  1. The BoM pricing is displayed in GBP (£)
Image
  1. Open the Stock tab for the same Part
  2. The Stock Value column is dispalayed in USD ($)
Image
  1. Open the BoM tab for the same part, here the prices are in the default currency EUR (€)
Image

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

Relevant log output

Activity

  1. added
    bug
    question
    triage:not-checked
    on Oct 19, 2025
  2. SchrodingersGat commented on Oct 19, 2025

    @SchrodingersGat
    Member

    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

  3. added
    pricing
    and removed
    bug
    triage:not-checked
    on Oct 19, 2025
  4. gunstr commented on Oct 20, 2025

    @gunstr
    ContributorAuthor

    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:

    Image

    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.

    Image

    I will try to recreate on the Demo site and report back.

  5. gunstr commented on Oct 20, 2025

    @gunstr
    ContributorAuthor

    I think I found what is causing the issue. To reproduce on the Demo site:

    1. Set the Base currency to EUR
    2. Create and issue a Build Order for 1pc of the Blue Chair
    3. Allocate stock for all required parts
    4. Add Incomplete Output
    5. Hit "Edit" for the Incomplete Output, the Currency is set to USD rather than EUR. Easy to miss as you normally do not edit at this stage. Close without changing the Currency.
    Image
    1. Complete the output
    2. Hit the Completed Outputs tab. The Stock Value is in USD:
    Image
    1. The numeric value is actually the same as the Part Pricing Overview in EUR
    Image

    I think this boils down to two things:

    1. The Currency for the new build output should be set to the base currency as default
    2. If it's anyway decided to use a different currency for the build output (not sure if there is a use case for that...) the numeric value should be recalculated accordingly

    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?

  6. SchrodingersGat commented on Oct 20, 2025

    @SchrodingersGat
    Member

    @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.

    would it not make sense to freeze a Unit value for build outputs at the time of creation?

    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:

    • Received against a purchase order
    • Built against a build order
    • Filled out manually

    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.

  7. gunstr commented on Oct 20, 2025

    @gunstr
    ContributorAuthor

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pricingquestion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions