[IMP] sale_product_configurator: Make module auto_install
Part-of: odoo/odoo#82999
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -32,17 +32,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box" id="product_configurator">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_sale_product_configurator"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_sale_product_configurator"/>
|
||||
<div class="text-muted">
|
||||
Select product attributes and optional products from the sales order
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box" id="product_matrix">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_sale_product_matrix"/>
|
||||
|
||||
@@ -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',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user