[FIX] sale: exclude all attributes

With the demo data:
- Go to Sale > Products > Products, search for 'Customizable Desk'
- Click on 'Configure Variants'
- For variant 'Legs: Steel', add all attribute values for the
  'Conference Chair'
- Create a SO, add a line with 'Configure Product'
- Select the 'Customizable Desk' with 'Legs: Steel', add

Boom boom, traceback at template rendering at
`first_possible_combination[variant_id_index] == value_id`

This is because the `parent_combination` is not taken into account when
evaluating `_is_add_to_cart_possible`.

closes odoo/odoo#31496

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2019-03-14 08:08:45 +00:00
parent 35221a3243
commit b5921fbfa8
@@ -152,7 +152,7 @@
<template id="optional_product_items">
<t t-foreach="product.optional_product_ids" t-as="product">
<t t-set="first_possible_combination" t-value="product._get_first_possible_combination(parent_combination)"/>
<t t-if="product._is_add_to_cart_possible()">
<t t-if="product._is_add_to_cart_possible(parent_combination)">
<t t-set="combination_info" t-value="product._get_combination_info(first_possible_combination, add_qty=add_qty or 1, pricelist=pricelist)"/>
<t t-set="product_variant" t-value="product.env['product.product'].browse(combination_info['product_id'])"/>