From ee3bf990d9160b085f5700a5ee69c781e9794fa2 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Mon, 24 Jan 2022 11:32:26 +0000 Subject: [PATCH] [IMP] sale_product_configurator: Make module auto_install Part-of: odoo/odoo#82999 --- addons/product/models/res_config_settings.py | 19 +------------------ .../sale/views/res_config_settings_views.xml | 11 ----------- .../sale_product_configurator/__manifest__.py | 3 ++- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/addons/product/models/res_config_settings.py b/addons/product/models/res_config_settings.py index aa4eb826162..e584695898e 100644 --- a/addons/product/models/res_config_settings.py +++ b/addons/product/models/res_config_settings.py @@ -10,7 +10,6 @@ class ResConfigSettings(models.TransientModel): group_discount_per_so_line = fields.Boolean("Discounts", implied_group='product.group_discount_per_so_line') group_uom = fields.Boolean("Units of Measure", implied_group='uom.group_uom') group_product_variant = fields.Boolean("Variants", implied_group='product.group_product_variant') - module_sale_product_configurator = fields.Boolean("Product Configurator") module_sale_product_matrix = fields.Boolean("Sales Grid Entry") group_stock_packaging = fields.Boolean('Product Packagings', implied_group='product.group_stock_packaging') @@ -38,18 +37,9 @@ class ResConfigSettings(models.TransientModel): def _onchange_group_product_variant(self): """The product Configurator requires the product variants activated. If the user disables the product variants -> disable the product configurator as well""" - if self.module_sale_product_configurator and not self.group_product_variant: - self.module_sale_product_configurator = False if self.module_sale_product_matrix and not self.group_product_variant: self.module_sale_product_matrix = False - @api.onchange('module_sale_product_configurator') - def _onchange_module_sale_product_configurator(self): - """The product Configurator requires the product variants activated - If the user enables the product configurator -> enable the product variants as well""" - if self.module_sale_product_configurator and not self.group_product_variant: - self.group_product_variant = True - @api.onchange('group_product_pricelist') def _onchange_group_sale_pricelist(self): if not self.group_product_pricelist and self.group_sale_pricelist: @@ -63,14 +53,7 @@ class ResConfigSettings(models.TransientModel): self.group_sale_pricelist = True def set_values(self): - super(ResConfigSettings, self).set_values() + super().set_values() if not self.group_discount_per_so_line: pl = self.env['product.pricelist'].search([('discount_policy', '=', 'without_discount')]) pl.write({'discount_policy': 'with_discount'}) - - @api.onchange('module_sale_product_matrix') - def _onchange_module_module_sale_product_matrix(self): - """The product Grid Configurator requires the product Configurator activated - If the user enables the Grid Configurator -> enable the product Configurator as well""" - if self.module_sale_product_matrix and not self.module_sale_product_configurator: - self.module_sale_product_configurator = True diff --git a/addons/sale/views/res_config_settings_views.xml b/addons/sale/views/res_config_settings_views.xml index c3ad55b67b1..f9caecb571e 100644 --- a/addons/sale/views/res_config_settings_views.xml +++ b/addons/sale/views/res_config_settings_views.xml @@ -32,17 +32,6 @@ -
-
- -
-
-
-
diff --git a/addons/sale_product_configurator/__manifest__.py b/addons/sale_product_configurator/__manifest__.py index c9dd7a6188c..6c6882b9663 100644 --- a/addons/sale_product_configurator/__manifest__.py +++ b/addons/sale_product_configurator/__manifest__.py @@ -7,7 +7,7 @@ 'summary': "Configure your products", 'description': """ -Technical module installed when the user checks the "module_sale_product_configurator" setting. +Technical module: The main purpose is to override the sale_order view to allow configuring products in the SO form. It also enables the "optional products" feature. @@ -39,5 +39,6 @@ It also enables the "optional products" feature. 'sale_product_configurator/static/tests/product_configurator.test.js', ], }, + 'auto_install': True, 'license': 'LGPL-3', }