inventree / InvenTree

Open Source Inventory Management System
https://docs.inventree.org
MIT License
4.27k stars 772 forks source link

[BUG] After part price updated, BOM sort by price order shows old order #3326

Closed Zontex closed 1 year ago

Zontex commented 2 years ago

Describe the bug

I manually updated the component price and then went back to the BOM of the part and set to order by price (from the most expensive one to the cheapest one) but still, the position of the component was the old position even tho it's the most expensive component in the list.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to parts
  2. Click on the bill of materials
  3. Click on "supplier cost" to sort based on supplier cost
  4. Go to one of the parts (not the first one) in the list
  5. Change the component price to be more expensive than other components in the list
  6. Go back to the bill of materials and repeat step 3 to see that it's still in the same position.

Expected behavior

The most expensive component should be in first place in the list, according to the updated pricing.

Screenshots

Screen Shot 2022-07-14 at 13 57 02

Deployment Method

Version Information

inventree version: 3.10.4 django version: 3.2.14

SchrodingersGat commented 2 years ago

@Zontex I am unable to reproduce this with a trivial example... Which version of InvenTree are you running? 3.10.4 is not a valid InvenTree version number

Zontex commented 2 years ago

@SchrodingersGat Sorry my bad:

version: 0.8.0 dev commit hash: 67732f8f8 commit date: 2022-07-11

Zontex commented 2 years ago
Screen Shot 2022-07-14 at 23 43 43

Just lowered to stable branch 0.7.4 and still see the issue, if you look at the screenshot the issue is with the table not showing from the highest price to the lowest although using the filtering function.

SchrodingersGat commented 2 years ago

@Zontex looks like it is using string sorting rather than numerical (natural) sorting! Given the other major work needed on pricing, this will have to wait for next release cycle.