TIP: You can type at any time to perform a new search.
Product Variant Default Code
product_variant_default_code · OCA/product-variant
- Repository
- OCA/product-variant · module folder · Try on Runboat
- Module version
- 1.0.0
- Category
- Product
- Folder size
- 0.21 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/product-variant
- Last tracking update
- 2026-08-07 09:06:27
- Authors
- Akretion, Odoo Community Association (OCA), Tecnativa, AvancOSC, Shine IT
- Maintainers
- Akretion, Odoo Community Association (OCA), Tecnativa, AvancOSC, Shine IT
- Committers
- Weblate, OCA-git-bot, oca-ci, arantxa-s73
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
- Description
This module automatically generate Product Reference (default_code) according to attributes data with a configurable behavior. It defines a reference mask on the product templates so the variants references are automatically set. For example: - Product template: Jacket - Attributes: - Color: White, Black - Size: M, L - Reference mask: JKT01-\[Color\]-\[Size\] - Reference on variants: - JKT01-Wh-M Jacket White M - JKT01-Bl-M Jacket Black M - JKT01-Wh-L Jacket White L - JKT01-Bl-L Jacket Black L
Code Analysis ⓘ
Views touched (7)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
attribute_tree_view |
product.attribute | tree | Inherits product.attribute_tree_view | |
product_normal_form_view |
product.product | form | Inherits product.product_normal_form_view | |
product_template_only_form_view |
product.template | form | Inherits product.product_template_only_form_view | |
product_variant_easy_edit_view |
product.product | Inherits product.product_variant_easy_edit_view | ||
view_general_configuration |
res.config.settings | form | Inherits base_setup.res_config_settings_view_form | |
view_product_attribute_form |
product.attribute | form | Inherits product.product_attribute_view_form | |
view_product_attribute_search |
product.attribute | search | New |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (5)
New fields (1)
-
codeCharstring='Attribute Code'
No public methods.
New fields (1)
-
codeCharcompute='_compute_code'readonly=Falsestore=Truestring='Attribute Value Code'
No public methods.
New fields (2)
-
default_codeCharcompute='_compute_default_code'inverse='_inverse_default_code'readonly=Falsestore=True -
manual_codeBooleandefault=Falsestring='Manual Reference'
No public methods.
New fields (3)
-
code_prefixCharhelp='Add prefix to product variant reference (default code)'string='Reference Prefix' -
reference_maskCharcompute='_compute_reference_mask'copy=Falsehelp='Reference mask for building internal references of a variant generated from this template.\nExample:\nA product named ABC with 2 attributes: Size and Color:\nProduct: ABC\nColor: Red(r), Yellow(y), Black(b) #Red, Yellow, Black are the attribute value, `r`, `y`, `b` are the corresponding code\nSize: L (l), XL(x)\nWhen setting Variant reference mask to `[Color]-[Size]`, the default code on the variants will be something like `r-l` `b-l` `r-x` ...\nIf you like, You can even have the attribute name appear more than once in the mask. Such as,`fancyA/[Size]~[Color]~[Size]`\n When saved, the default code on variants will be something like \n `fancyA/l~r~l` (for variant with Color "Red" and Size "L") `fancyA/x~y~x` (for variant with Color "Yellow" and Size "XL")\nNote: make sure characters "[,]" do not appear in your attribute name'inverse='_inverse_reference_mask'store=Truestring='Variant reference mask' -
variant_default_code_errorTextcompute='_compute_variant_default_code_error'
-
create(self, vals_list)@api.model_create_multi -
is_automask(self)
New fields (2)
-
group_product_default_code_manual_maskBooleandefault=Falsehelp='Set behaviour of codes. Default: Automask (depends on variant use: see Sales/Purchases configuration)'implied_group='product_variant_default_code.group_product_default_code_manual_mask'string='Product Default Code Manual Mask' -
prefix_as_default_codeBooleanconfig_parameter='product_variant_default_code.prefix_as_default_code'default=Falsestring='Reference Prefix as default Reference'
No public methods.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…