Skip to content

odoo/odoo

16.0
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

Current behaviour:
In the context that a variant is being archived after the removal of
one of it's attribute lines, on the e-commerce product's page of
said product some of the attribute values are disabled because they
were part of the archived variant.

Expected behaviour:
Archiving a variant due to removal of an attribute line shouldn't
disable the selection of the other attributes on the e-commerce
product's page of the product, since the variant can never be
reconstituted (the current selection of attributes lines is `X-1`,
where `X` is the number of attribute lines of the archived variant).

Steps to reproduce:
- Install eCommerce,
- Create a product with 2 attribute lines and add values A1,A2 and
  B1,B2 respectively, 4 variants should be created (cross-product).
- Go on the e-commerce product's page of the product, add the
  variant A2,B1 to the cart
- Go in the backend, delete attribute line (B1,B2), from the product
  template
- Go back on the e-commerce product's page, the option with A2 is
  disabled.

Reason for the problem:
When deleting an attribute line from a `product.template`, if one of
the variant is being used somewhere (in our case as a `sale.order.
line` of the cart), it is archived instead of deleted. This means
that when loading the page of the product with send the attribute
values of the archived products, so we can disable the selection of
the attributes that would make the archived variant. Since A2 is
part of the variant A2,B1 that was archived, we disable the
selection for A2, without taking into account that we don't have the
same number of attributes than the archived variant and it is
impossible to make the archived variant from the e-commerce
product's page.

Fix:
Restrain the condition that checks for which attributes to disable.
We make sure that we have *any* common part of the selection to the
archived variant, and we also make sure the count of the attributes
for the product is the same as the archived variant we are checking
against.

Affected versions:
- 16.0
- saas-16.1
- saas-16.2
- saas-16.3
- master

opw-3329225

closes #124344

Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
4114418

Files

Permalink
Failed to load latest commit information.

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials