Product Variant Default Code
product_variant_default_code · OCA/product-variant
Health
80/100
good
-
Security25/25No findings
-
Activity25/25Last human commit 6 months ago
-
Required by5/250 modules depend on it
-
Maturity25/25In 10 Odoo series since 10.0
Heuristic over the facts below, not an audit · How it's computed
Required by
0
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.21 MB
Module directory on disk
Code analysis
0 migration notes
5 models
7 views
0 HTTP endpoints
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
Dependencies
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
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…