Product Variant Configurator
product_variant_configurator · OCA/product-variant
product_variants_no_automatic_creation (9.0)-
Security25/25No findings
-
Activity25/25Last human commit 4 months ago
-
Required by20/252 modules depend on it
-
Maturity25/25In 11 Odoo series since 9.0
Heuristic over the facts below, not an audit · How it's computed
Description
Provides an abstract model for product variant configuration. It provides the basic functionality for presenting a table with the attributes of a template and the possibility to select one of the valid values. You can try this functionality creating a product variant directly selecting a product template that has attributes.
This module also prevents in a configurable way the creation of the product variants when defining the attributes and attribute values of the product template.
Dependencies
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- purchase_variant_configurator, sale_variant_configurator
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 6
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
product_attribute_view_form |
product.attribute.form | product.attribute | form | Inherits product.product_attribute_view_form |
product_category_no_variant_form_view |
product.category.no.variant.form | product.category | form | Inherits product.product_category_form_view |
product_template_no_variant_form_view |
product.template.no.variant.form | product.template | form | Inherits product.product_template_only_form_view |
product_variants_view |
product.product.variants.form | product.product | form | Inherits product.product_normal_form_view |
product_variants_view_2 |
product.product.variants.form | product.product | form | Inherits product_variant_configurator.product_variants_view |
view_product_configurator_tree |
product.configurator.attribute | list | New |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 9
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (1)-
create(self, vals_list)@api.model_create_multiLink created attribute value to the associated template if proceed. This happens when quick-creating values from the product configurator.
-
no_create_variantsBooleandefault=Truehelp='This check disables the automatic creation of product variants for all the products of this category.'string="Don't create variants automatically"
-
onchange_no_create_variants(self)@api.onchange('no_create_variants') -
write(self, values)
-
can_create_productBooleancompute='_compute_can_be_created' -
create_product_variantBooleanstring='Create product now!' -
price_extraFloatcompute='_compute_price_extra'digits='Product Price'help='Price Extra: Extra price for the variant with the currently selected attributes values on sale price. eg. 200 price extra, 1000 + 200 = 1200.' -
product_attribute_idsOne2many → product.configurator.attributecomodel_name='product.configurator.attribute'copy=Truedomain=<expr>inverse_name='owner_id'string='Product attributes' -
product_idMany2one → product.productcomodel_name='product.product'string='Product Variant' -
product_id_configurator_domainBinarycompute='_compute_product_id_configurator_domain'readonly=Truestore=False -
product_tmpl_idMany2one → product.templatebypass_search_access=Truecomodel_name='product.template'string='Product Template'
-
create(self, vals_list)@api.model_create_multiFill `product_tmpl_id` in case `product_id` is supplied but not the other one. -
create_variant_if_needed(self)Create the product variant if needed. It searches for an existing product with the selected attributes. If not found, create a new product. :returns: the product (found or newly created) -
unlink(self)Mimic `ondelete="cascade"`.
-
attribute_idMany2one → product.attributecomodel_name='product.attribute'readonly=Truestring='Attribute' -
owner_idMany2oneReferenceindex=Truemodel_field='owner_model'required=Truestring='Owner' -
owner_modelCharrequired=True -
possible_value_idsMany2many → product.attribute.valuecomodel_name='product.attribute.value'compute='_compute_possible_value_ids'readonly=True -
price_extraFloatcompute='_compute_price_extra'digits='Product Price'help='Price Extra: Extra price for the variant with this attribute value on sale price. eg. 200 price extra, 1000 + 200 = 1200.'string='Attribute Price Extra' -
product_tmpl_idMany2one → product.templatecomodel_name='product.template'required=Truestring='Product Template' -
value_idMany2one → product.attribute.valuecomodel_name='product.attribute.value'domain="[('id', 'in', possible_value_ids)]"string='Value'
No public methods.
No new fields.
Public methods (2)-
template_price_get(self, prod_id, qty, partner=None) -
template_price_rule_get(self, prod_id, qty, partner=None)
No new fields.
Public methods (1)-
create(self, vals_list)@api.model_create_multi
-
no_create_variantsSelectiondefault='no'help='This selection defines if variants for all attribute combinations are going to be created automatically at saving time.'required=Truestring='Variant creation' args: [('yes', "Don't create them automatically"), ('no', "Use Odoo's default variant management"), ('empty', 'Use the category value')]
-
create(self, vals_list)@api.model_create_multi -
name_search(self, name='', domain=None, operator='ilike', limit=100)@api.model -
onchange_no_create_variants(self)@api.onchange('no_create_variants') -
write(self, values)
-
requiredBooleandefault=False
No public methods.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…