Skip to content

"Auto Pricing" overwrites manually entered Purchase Price #10846

Closed

Description

@JustusRijke

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

Note: this is more or less a duplicate of #7600, but because that was targeting the previous UI I thought it might be better to raise a new issue.

When modifying the purchase price of a line item of a purchase order, the price entered by the user is overwritten by the Auto Pricing functionality. This leads the user to believe the price has been modified, where in fact it stayed the same.

Steps to Reproduce

  1. Open a purchase order with line items with historical pricing information, e.g. https://demo.inventree.org/web/purchasing/purchase-order/1/line-items
  2. Edit a line item -> modify purchase price -> submit
  3. Purchase price hasn't changed...

Expected behaviour

When modifying the purchase price, the "Auto Pricing" slider should disable automatically.

It'd be nice if, when pressing enter, the form is submitted.

Deployment Method

Other - added info in Steps to Reproduce

Version Information

InvenTree-Version: 1.2.0 dev
Django Version: 5.2.8
Commit Hash: 770f7a2
Commit Date: 2025-11-16
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 Nov 17, 2025
  2. added
    pricing
    User Interface
    and removed
    triage:not-checked
    on Nov 18, 2025
  3. added this to the 1.2.0 milestone on Nov 18, 2025
  4. SchrodingersGat commented on Nov 18, 2025

    @SchrodingersGat
    Member

    @JustusRijke thanks for reporting - I've got an idea of how to fix this but need some time to look into it

  5. SchrodingersGat commented on Nov 19, 2025

    @SchrodingersGat
    Member

    Potential fix incoming in #10867

  6. SchrodingersGat commented on Dec 9, 2025

    @SchrodingersGat
    Member

    @JustusRijke I believe that this has now been addressed - can you please check the current behavior on master branch (i.e. in demo server if you don't run on master) and confirm?

  7. JustusRijke commented on Dec 9, 2025

    @JustusRijke
    ContributorAuthor

    @SchrodingersGat Just tried on the demo server, the problem is still there. Changing the purchase price on this line item and saving it has no effect. Which makes sense, because the Auto Pricing slide is still enabled.

    Image

    Version:

    InvenTree-Version: 1.2.0 dev
    Django Version: 5.2.9
    Commit Hash: bed83bc
    Commit Date: 2025-12-09
    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
    
  8. SchrodingersGat commented on Dec 10, 2025

    @SchrodingersGat
    Member

    @JustusRijke ah ok, subtle difference there. Would you be able to submit a patch to address this?

  9. JustusRijke commented on Dec 11, 2025

    @JustusRijke
    ContributorAuthor

    @SchrodingersGat I can take a stab at it but the InvenTrree front-end stack is something I've never worked with so it might take some time.

    FYI: I noticed that the wanted behavior (automatically disabling the auto pricing slide when entering a price) works fine when adding a new line item. It's just that this functionality is not yet implemented when modifying an existing line item.

  10. 1 remaining item

  11. JustusRijke commented on Dec 23, 2025

    @JustusRijke
    ContributorAuthor

    @SchrodingersGat Not sure yet how to handle this..

    Current behavior

    • When adding a line item, auto pricing is enabled by default and the purchase price field is empty. Entering a value automatically disables auto pricing. Makes sense.
    • When editing a line item:
      • Auto pricing is enabled by default, even if it was disabled when the line item was added --> this feels unexpected.
      • Even though auto pricing is enabled, the purchase price field is populated --> debatable behavior.

    Possible behavior 1

    • For both add and edit forms: when auto pricing is enabled, disable (gray out) the purchase price field and clear it (or update it to the calculated value so the user knows right away what the calculated value will be). This clearly communicates intent.
    • However, this raises questions about what should happen when the user is editing the line item AND the automatically calculated price has changed since the line item was added or last edited. This could get complicated quickly.

    Possible behavior 2

    • In the edit form: disable auto pricing by default.
    • When the user enables auto pricing, gray out the purchase price field and clear it or update it to the calculated value.

    Possible behavior 3

    • Remove the auto pricing slider entirely.
    • Add an “Auto pricing” button next to the purchase price field. When clicked, it updates the purchase price with the automatically calculated value. This makes user intent very explicit.
    • Optionally, always populate purchase price with the calculated price when adding a line item. That way, the new behavior is similar to the current behavior (i.e., auto pricing enabled when adding a line item).

    Curious to hear your thoughts!

  12. SchrodingersGat commented on Jan 6, 2026

    @SchrodingersGat
    Member

    I think that option 2 would make the most sense.

    @wolflu05 I believe that you implemented this feature, yes? What are your thoughts here?

  13. JustusRijke commented on Feb 3, 2026

    @JustusRijke
    ContributorAuthor

    @wolflu05 bump 🙂

  14. wolflu05 commented on Feb 3, 2026

    @wolflu05
    Member

    Yes, I think option 2 also makes the most sense. Because I think the price must be captured on the moment we buy something. Because suppliers tend to update the price from time to time. If we would just add a reference if auto pricing is enabled, that would not make any sense.

  15. SchrodingersGat commented on Feb 11, 2026

    @SchrodingersGat
    Member

    @JustusRijke are you keen to implement 2) ?

  16. JustusRijke commented on Feb 11, 2026

    @JustusRijke
    ContributorAuthor

    @SchrodingersGat yes! But it's typically something that gets pushed down my to-do list forever - have you got a deadline in mind?

  17. SchrodingersGat commented on Feb 11, 2026

    @SchrodingersGat
    Member

    @JustusRijke I'll bump it to the next release cycle, as we are trying to close out the 1.2.0 target. Do you think you will get to it in the next month or so?

  18. modified the milestones: 1.2.0, 1.3.0 on Feb 11, 2026
  19. JustusRijke commented on Feb 11, 2026

    @JustusRijke
    ContributorAuthor

    @SchrodingersGat Yes that should be doable

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

Metadata

Metadata

Labels

User Interfacebugpricingquestion

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions