Skip to content
Snippets Groups Projects
Commit b5921fbf authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[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: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 35221a32
No related branches found
No related tags found
No related merge requests found
......@@ -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'])"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment