OCA / e-commerce

Odoo E-Commerce server automation addons
GNU Affero General Public License v3.0
170 stars 494 forks source link

[IMP] website_sale_product_assortment #975

Open Pablocce opened 1 month ago

Pablocce commented 1 month ago

Description:

When more than one assortment is applied to the customer on e-commerce, the functionality doesn't work correctly, and the configurations are not applied properly, for example, when combining "no restriction" with "no show" or "no purchase."

This PR is essential for the functionality of this module because the products are not shown or cannot be bought when they should.

Cases covered with this improvement:

  1. Assortment A with product 1 and configuration "Avoid to show non available products" and assortment B with product 2 and configuration "Avoid to show non available products". Before, both products were displayed with the label "Not available". With this PR both products are displayed and they are allowed to be purchased.
  2. Assorment A with product 1 and configuration "Avoid to show non available products" and assortment B with product 2 and configuration "No restrictions". Before, only the products from de assortment A were displayed, restricting the products from de B assortment. With this PR, the restrictions are not applied to the assortments with the configuration "No restrictions" when simultaneous assortments are applied to the same client or website.

Solution: To resolve this problem, we have made the following modifications:

  1. The method that returns the products to display is adjusted so that, in the absence of restrictive stock, it correctly returns the values.
  2. Additionally, the method that returns the products and their restrictions is adjusted to make the assortments compatible.
OCA-git-bot commented 1 month ago

Hi @CarlosRoca13, some modules you are maintaining are being modified, check this out!

CarlosRoca13 commented 2 weeks ago

And if you can, add a test to check that is working OK on future migrations :smile:

CarlosRoca13 commented 2 weeks ago

Ups! the whitespaces still there...

Pablocce commented 2 weeks ago

Ups! the whitespaces still there...

Done! I was doing the rebase, thanks!

OCA-git-bot commented 2 weeks ago

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖