Skip to content

[Bug]: Failing to convert units in parameters #12814

Closed

Description

@CraigBurden

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

I have a "Resistance" parameter for my resistors, however I am unable to enter a resistance in RKM format as I have before.

Image

I have tried changing the units from 'R' to 'ohm' to 'ohms' and none work. I have also tried 'k', 'K' and to test I have tried 'R', 'M' and 'm'. None are accepted

The only input that I am able to submit successfully is 18000, but even then the tooltip doesn't suggest that the units are understood, no value in the base unit is shown:

Image

I previously opened #12063 so this isn't a broader RKM issue. But I did just open #12813 and I wonder if that may be related?

Steps to Reproduce

Create a parameter with 'R', 'ohm' or 'ohms', then try to use it

Expected behaviour

Any valid RKM fomatted unit should be accepted and correctly converted into the base units

Deployment Method

Docker

Version Information

InvenTree-Version: 1.5.2
Django Version: 5.2.16
Commit Hash: f15e35c
Commit Date: 2026-08-25
Commit Branch: null
Database: django.db.backends.postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-6.12.105+deb13-cloud-amd64-x86_64-with-glibc2.41
Installer: DOC
Active plugins: [{"name":"InvenTreeBarcode","slug":"inventreebarcode","version":"2.2.0"},{"name":"BOM Exporter","slug":"bom-exporter","version":"1.1.0"},{"name":"InvenTree Exporter","slug":"inventree-exporter","version":"1.0.0"},{"name":"Parameter Exporter","slug":"parameter-exporter","version":"2.0.0"},{"name":"InvenTreeEmailNotifications","slug":"inventree-email-notification","version":"1.0.0"},{"name":"InvenTreeUINotifications","slug":"inventree-ui-notification","version":"1.0.0"},{"name":"InvenTreeCurrencyExchange","slug":"inventreecurrencyexchange","version":"1.0.0"},{"name":"InvenTreeMachines","slug":"inventree-machines","version":"1.0.0"},{"name":"InvenTreeLabel","slug":"inventreelabel","version":"1.1.0"},{"name":"InvenTreeLabelMachine","slug":"inventreelabelmachine","version":"1.0.0"},{"name":"PartChangeLog","slug":"partchangelog","version":"1.0.17"},{"name":"IPNGenerator","slug":"ipngen","version":"0.4.0"}]

Try to reproduce on the demo site

I did not try to reproduce

Is the bug reproducible on the demo site?

Not reproducible

Relevant log output

I have reviewed this report for correctness and filled out all sections.

  • I have checked this report. I acknowledge that filing bugs via AI agents without review might lead to being blocked.

Activity

  1. added
    bug
    question
    triage:not-checked
    on Sep 7, 2026
  2. added theissue type on Sep 7, 2026
  3. CraigBurden commented on Sep 7, 2026

    @CraigBurden
    Author

    Randomly just after posting this, I got a notification of a server error that appears to be related, although for a different part:

    Task 'common.tasks.rebuild_parameters (3fed4d5ac63a4c5a98c64865a1549b69)' failed after 5 attempts

    {'data': ['Could not convert 1.5mR to R']} : Traceback (most recent call last):
      File "/root/.local/lib/python3.14/site-packages/django_q/worker.py", line 104, in worker
        res = f(*task["args"], **task["kwargs"])
      File "/usr/local/lib/python3.14/contextlib.py", line 85, in inner
        return func(*args, **kwds)
      File "/home/inventree/src/backend/InvenTree/common/tasks.py", line 201, in rebuild_parameters
        parameter.full_clean()
        ~~~~~~~~~~~~~~~~~~~~^^
      File "/home/inventree/src/backend/InvenTree/InvenTree/models.py", line 145, in full_clean
        super().full_clean(*args, **kwargs)
        ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
      File "/root/.local/lib/python3.14/site-packages/django/db/models/base.py", line 1679, in full_clean
        raise ValidationError(errors)
    django.core.exceptions.ValidationError: {'data': ['Could not convert 1.5mR to R']}
    
  4. CraigBurden commented on Sep 7, 2026

    @CraigBurden
    Author

    @SchrodingersGat pointed out in #12813 that I should list Custom units, I had a old unit from before the fix to #12063 was released.

    Image

    I removed the unit and now everything is working as expected!

    This is still undesirable behavior, so perhaps a fix is needed?

  5. removed
    triage:not-checked
    on Sep 10, 2026
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

    bugquestion

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions