odoo / odoo

Odoo. Open Source Apps To Grow Your Business.
https://www.odoo.com
Other
37.51k stars 24.4k forks source link

Wrong sorting by price on eCommerce #27743

Closed pablo-lp closed 5 years ago

pablo-lp commented 5 years ago

Impacted versions: Odoo V11

Steps to reproduce:

Go to Website -> Settings -> Sale pricing settings and enable Multiple sale prices per product Go to Pricelists and add a product to one (with a different price to Sales Price) Assign that Pricelist to your user Go to shop (eCommerce) Sort by price

Current behavior: The prices are displayed correctly, but the products are ordered by the Sales Price instead of the displayed Pricelist price.

Expected behavior: Products should be sorted according to the price showed

Video/Screenshot link (optional):

odoo-11-sort-problem

sswapnesh commented 5 years ago

Hello @pablo-lp I am able to Reproduce Same on Latest v11 Runbot Build http://384287-11-0-57ae94.runbot15.odoo.com/shop?order=list_price+asc and confirm this as bug.

Adding Steps to Reproduce with Screenshots: Tested With Admin user screenshot 14

Enable Pricelist screenshot 15 screenshot 16 screenshot 17

It Looks like Products are sorted and than Pricelist is applied to display Price.

pedrobaeza commented 5 years ago

@JKE-be for you

JKE-be commented 5 years ago

Hello

It is by design!

Filter is based on the Catalogue price and not the display price!

If you have thousand of products, it will be very slow to calculate it !

sswapnesh commented 5 years ago

But still It is Confusing for End user. Will be better if you consider as Wishlist.

pablo-lp commented 5 years ago

The prices are already taken from the Pricelist so it should not be slower to sort the records using that price, in my opinion. I consider it a design error

JKE-be commented 5 years ago

@pablo-lp

The prices are already taken from the Pricelist..., in my opinion. You are wrong, it uses the float field list_price on the product record.

... it should not be slower to sort the records using that price, in my opinion. You are wrong, it will be slower to recompute each price for your current pricelist. So yes it could become very slow in case you have many product and pricelists !

I consider it a design error Not really imo, it is a reasonable trade off. A wishlist feature could be to allow to sort (if option enable only!) on website price. Like that it allow small eCommerce of 20 product to sort it by Website Price specifically!

AnilKesariya commented 3 years ago

Same issue for v13, still persist. Any suggestion if we can improve based on price list will not slower performance.

JKE-be commented 3 years ago

Yes, and unfortunately for v15 too.

There are no solutions to have something without 'slower' performance. You cannot do more with less resource. What we need is to find the good compromise

It has been done with a cache, but ofc it will not scale for big db, so just cancelled. Here the PR https://github.com/odoo/odoo/pull/33897, you can probably backport locally a part of this one

//cc @pierre-pde

JN-Klev commented 1 year ago

Is there already a solution for this? Same problem here (V15). And, what is 'slow'? I'd rather have a 'not so fast' but correct website than a fast but incorrect website.

JKE-be commented 1 year ago

What is slow is that you have to calculate for each product... what is the price for your current pricelist and your current promotion, ... Of course if you have a ~100 product, it is not a problem... but if you have 1000+ products, it become slow ...

It is not really wrong, it is just sorted by public sale price instead of your current customer price.

As mentioned in my previous comment, you can use code #33897 if you need it, but no plans to merge it into the main release.

KR