Denis Ledoux 01c68bc2a4 [FIX] website_sale: fix variants availability on website product page
This is an oversight during the conversion to the new API
in the revision
788c1334e2

In the above revision,
```
visible_attrs = set(l.attribute_id.id
                  for l in product.attribute_line_ids
                    if len(l.value_ids) > 1)
```
has been converted to
```
visible_attrs_ids = product.mapped('attribute_line_ids.attribute_id').filtered(lambda attr: len(attr.value_ids) > 1).ids
```
which leads to a change of behavior:

Before the conversion, the filter is applied on the attribute line `value_ids` field:
`if len(l.value_ids) > 1`, `l` being one item of `attribute_line_ids`
After the converison, the filter is applied on the attribute line `attribute_id.value_ids` field
`filtered(lambda attr: len(attr.value_ids) > 1)`, `attr` being the `attribute_id` field of one item of `attribute_line_ids`

Therefore breaking the availability of the product variants in the products pages of the ecommerce.

e.g.
Attribute color, values red, blue, white, black
The product "Tshirt" is defined with as possible colors values red only.

Before, the filter would not return the attribute `color` for this product,
as the product has only one possible value for this attribute
After, the filter would return the attribute `color`, since this attribute
as more than one possible values (but, not for this product)

opw-688470
2016-09-14 12:59:15 +02:00
…
…
…
…
…
…
…
…
…

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, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...

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.

If you are a developer you may type the following command at your terminal:

wget -O- https://raw.githubusercontent.com/odoo/odoo/9.0/odoo.py | python

Then follow the developer tutorials

For Odoo employees

To add the odoo-dev remote use this command:

$ ./odoo.py setup_git_dev

To fetch odoo merge pull requests refs use this command:

$ ./odoo.py setup_git_review
S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%