[FIX] sale_product_configurator, web: fix warning

This commit fixes an issue with the product configurator where if a
subproduct contains an on sale warning, the subproduct won't be added to
the quotation when the main product is added. In order to fix this issue,
it was needed to provide a way for the allowWarning option to be passed
from the addNew method of the basic_relational_model to the
_applyX2ManyChange method of the basic_model. This is done by propagating
the option through the command until it reaches the basic_model.

Since the issue is no longer present in 16.3, this forward port only
adds the test.

opw-3462462

closes odoo/odoo#145404

X-original-commit: 2204ced3e24773c34e9356fd5b1d658f8b330dd1
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
This commit is contained in:
Julien Carion (juca)
2023-12-07 20:00:42 +00:00
parent 68a6db4f96
commit a33028095f
2 changed files with 5 additions and 0 deletions
@@ -38,6 +38,9 @@ registry.category("web_tour.tours").add('sale_product_configurator_optional_prod
trigger: 'tr:has(div[name="o_sale_product_configurator_name"]:contains("Conference Chair")) button:has(i.fa-plus)',
}, {
trigger: 'button:contains(Confirm)',
}, {
trigger: '.o-default-button',
extra_trigger: '.modal-title:contains(Warning for Conference Chair (TEST))',
}, {
trigger: 'tr:has(td.o_data_cell:contains("Customizable Desk")) td.o_data_cell:contains("2.0")',
isCheck: true,
@@ -176,6 +176,8 @@ class TestProductConfiguratorUi(HttpCase, TestProductConfiguratorCommon):
(6, 0, [office_chair.product_tmpl_id.id, self.product_product_conf_chair.id])
]
})
self.product_product_conf_chair.sale_line_warn = 'warning'
self.product_product_conf_chair.sale_line_warn_msg = 'sold'
self.product_product_custo_desk.optional_product_ids = [
(4, self.product_product_conf_chair.id)
]