[FIX] sale_product_conf.: not store PNVAV on SOL if single PAV on PTAL
sale_product_configurator: not store product no variant attribute value
on the sale order line if there is a single product attribute value on
the product template attribute line.
Before this change, product no variant attribute values were not
displayed on the sale order line if there was only one product attribute
variant on the product template attribute line. This behavior was
altered in 7e42f381c3 when product configurators were migrated to Owl.
This commit ensures that when there is a single product attribute
variant on the product template attribute line, product no variant
attribute values are not displayed on the sale order line.
closes odoo/odoo#121265
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
This commit is contained in:
+1
-1
@@ -400,7 +400,7 @@ export class ProductConfiguratorDialog extends Component {
|
||||
|
||||
let noVariantCommands = [{ operation: "DELETE_ALL" }];
|
||||
const noVariantPTAVIds = product.attribute_lines.filter(
|
||||
ptal => ptal.create_variant === "no_variant"
|
||||
ptal => ptal.create_variant === "no_variant" && ptal.attribute_values.length > 1
|
||||
).map(ptal => { return {id: ptal.selected_attribute_value_id}});
|
||||
if (noVariantPTAVIds.length) noVariantCommands.push({
|
||||
operation: "ADD_M2M",
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ registry.category("web_tour.tours").add('sale_product_configurator_advanced_tour
|
||||
}, {
|
||||
trigger: 'button:contains(Confirm)',
|
||||
}, {
|
||||
trigger: 'td.o_data_cell:contains("Customizable Desk (TEST) (Custom, White, PAV9, PAV5, PAV1)")',
|
||||
trigger: 'td.o_data_cell:contains("Customizable Desk (TEST) (Custom, White, PAV9, PAV5, PAV1)"):not(:contains("PA9: Single PAV"))',
|
||||
isCheck: true,
|
||||
}, {
|
||||
trigger: 'td.o_data_cell:contains("Legs: Custom: Custom 1")',
|
||||
|
||||
@@ -72,6 +72,19 @@ class TestProductConfiguratorUi(HttpCase, TestProductConfiguratorCommon):
|
||||
'attribute_id': product_attribute.id
|
||||
} for i in range(1, 11) for product_attribute in product_attributes])
|
||||
|
||||
product_attribute_no_variant_single_pav = self.env['product.attribute'].create({
|
||||
'name': 'PA9',
|
||||
'display_type': 'radio',
|
||||
'create_variant': 'no_variant'
|
||||
})
|
||||
|
||||
self.env['product.attribute.value'].create({
|
||||
'name': 'Single PAV',
|
||||
'attribute_id': product_attribute_no_variant_single_pav.id
|
||||
})
|
||||
|
||||
product_attributes += product_attribute_no_variant_single_pav
|
||||
|
||||
product_template = self.product_product_custo_desk
|
||||
|
||||
self.env['product.template.attribute.line'].create([{
|
||||
|
||||
Reference in New Issue
Block a user