Product Variant Default Code

product_variant_default_code
REPOSITORY
REPOSITORYOCA/product-variant
GIT
GIThttps://github.com/OCA/product-variant.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/product-variant/tree/19.0/product_variant_default_code
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYProduct
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Akretion, AvancOSC, Shine IT
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Akretion, AvancOSC, Shine IT
COMMITTERS
COMMITTERSOCA-git-bot, oca-ci, arantxa-s73
WEBSITE
WEBSITEhttps://github.com/OCA/product-variant
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:40:48
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - html_editor
    - uom
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
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 IDNameModelTypeStatus
attribute_tree_view product.attribute field Inherits product.attribute_tree_view
product_normal_form_view product.product field Inherits product.product_normal_form_view
product_template_only_form_view product.template field Inherits product.product_template_only_form_view
product_variant_easy_edit_view product.product field Inherits product.product_variant_easy_edit_view
view_general_configuration res.config.settings xpath Inherits base_setup.res_config_settings_view_form
view_product_attribute_form product.attribute field Inherits product.product_attribute_view_form
view_product_attribute_search product.attribute search New
Models touched (5)

New fields (1)
  • code Char
    string='Attribute Code'
Public methods (0)

No public methods.

New fields (1)
  • code Char
    compute='_compute_code' readonly=False store=True string='Attribute Value Code'
Public methods (0)

No public methods.

New fields (2)
  • default_code Char
    compute='_compute_default_code' inverse='_inverse_default_code' readonly=False store=True
  • manual_code Boolean
    default=False string='Manual Reference'
Public methods (0)

No public methods.

New fields (3)
  • code_prefix Char
    help='Add prefix to product variant reference (default code)' string='Reference Prefix'
  • reference_mask Char
    compute='_compute_reference_mask' copy=False help='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=True string='Variant reference mask'
  • variant_default_code_error Text
    compute='_compute_variant_default_code_error'
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
  • is_automask(self)

New fields (2)
  • group_product_default_code_manual_mask Boolean
    default=False help='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_code Boolean
    config_parameter='product_variant_default_code.prefix_as_default_code' default=False string='Reference Prefix as default Reference'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/product-variant
GIT
GIThttps://github.com/OCA/product-variant.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/product-variant/tree/18.0/product_variant_default_code
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYProduct
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Akretion, AvancOSC, Shine IT
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Akretion, AvancOSC, Shine IT
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Bhavesh Heliconia
WEBSITE
WEBSITEhttps://github.com/OCA/product-variant
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:13
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - html_editor
    - uom
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
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 IDNameModelTypeStatus
attribute_tree_view product.attribute field Inherits product.attribute_tree_view
product_normal_form_view product.product field Inherits product.product_normal_form_view
product_template_only_form_view product.template field Inherits product.product_template_only_form_view
product_variant_easy_edit_view product.product field Inherits product.product_variant_easy_edit_view
view_general_configuration res.config.settings xpath Inherits base_setup.res_config_settings_view_form
view_product_attribute_form product.attribute field Inherits product.product_attribute_view_form
view_product_attribute_search product.attribute search New
Models touched (5)

New fields (1)
  • code Char
    string='Attribute Code'
Public methods (0)

No public methods.

New fields (1)
  • code Char
    compute='_compute_code' readonly=False store=True string='Attribute Value Code'
Public methods (0)

No public methods.

New fields (2)
  • default_code Char
    compute='_compute_default_code' inverse='_inverse_default_code' readonly=False store=True
  • manual_code Boolean
    default=False string='Manual Reference'
Public methods (0)

No public methods.

New fields (3)
  • code_prefix Char
    help='Add prefix to product variant reference (default code)' string='Reference Prefix'
  • reference_mask Char
    compute='_compute_reference_mask' copy=False help='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=True string='Variant reference mask'
  • variant_default_code_error Text
    compute='_compute_variant_default_code_error'
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
  • is_automask(self)

New fields (2)
  • group_product_default_code_manual_mask Boolean
    default=False help='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_code Boolean
    config_parameter='product_variant_default_code.prefix_as_default_code' default=False string='Reference Prefix as default Reference'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/product-variant
GIT
GIThttps://github.com/OCA/product-variant.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/product-variant/tree/17.0/product_variant_default_code
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYProduct
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Akretion, AvancOSC, Shine IT
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Akretion, AvancOSC, Shine IT
COMMITTERS
COMMITTERSPedro M. Baeza, Weblate, OCA-git-bot, oca-ci
WEBSITE
WEBSITEhttps://github.com/OCA/product-variant
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:20:06
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
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 IDNameModelTypeStatus
attribute_tree_view product.attribute field Inherits product.attribute_tree_view
product_normal_form_view product.product field Inherits product.product_normal_form_view
product_template_only_form_view product.template field Inherits product.product_template_only_form_view
product_variant_easy_edit_view product.product field Inherits product.product_variant_easy_edit_view
view_general_configuration res.config.settings xpath Inherits base_setup.res_config_settings_view_form
view_product_attribute_form product.attribute field Inherits product.product_attribute_view_form
view_product_attribute_search product.attribute search New
Models touched (5)

New fields (1)
  • code Char
    string='Attribute Code'
Public methods (0)

No public methods.

New fields (1)
  • code Char
    compute='_compute_code' readonly=False store=True string='Attribute Value Code'
Public methods (0)

No public methods.

New fields (2)
  • default_code Char
    compute='_compute_default_code' inverse='_inverse_default_code' readonly=False store=True
  • manual_code Boolean
    default=False string='Manual Reference'
Public methods (0)

No public methods.

New fields (3)
  • code_prefix Char
    help='Add prefix to product variant reference (default code)' string='Reference Prefix'
  • reference_mask Char
    compute='_compute_reference_mask' copy=False help='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=True string='Variant reference mask'
  • variant_default_code_error Text
    compute='_compute_variant_default_code_error'
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
  • is_automask(self)

New fields (2)
  • group_product_default_code_manual_mask Boolean
    default=False help='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_code Boolean
    config_parameter='product_variant_default_code.prefix_as_default_code' default=False string='Reference Prefix as default Reference'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/product-variant
GIT
GIThttps://github.com/OCA/product-variant.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/product-variant/tree/16.0/product_variant_default_code
VERSION
VERSION 1.1.4
CATEGORY
CATEGORYProduct
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Akretion, AvancOSC, Shine IT
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Akretion, AvancOSC, Shine IT
COMMITTERS
COMMITTERSPedro M. Baeza, GitHub, Weblate, OCA-git-bot, Florent THOMAS, oca-ci, pilarvargas-tecnativa, Gil Arasa Verge, RabbitJon-S73, Raul-S73, Ignacio J. Ortega, aliciagarzo
WEBSITE
WEBSITEhttps://github.com/OCA/product-variant
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:48
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (7)
XML IDNameModelTypeStatus
attribute_tree_view product.attribute field Inherits product.attribute_tree_view
product_normal_form_view product.product field Inherits product.product_normal_form_view
product_template_only_form_view product.template field Inherits product.product_template_only_form_view
product_variant_easy_edit_view product.product field Inherits product.product_variant_easy_edit_view
view_general_configuration res.config.settings xpath Inherits base_setup.res_config_settings_view_form
view_product_attribute_form product.attribute field Inherits product.product_attribute_view_form
view_product_attribute_search product.attribute search New
Models touched (5)

New fields (1)
  • code Char
    string='Attribute Code'
Public methods (0)

No public methods.

New fields (1)
  • code Char
    compute='_compute_code' readonly=False store=True string='Attribute Value Code'
Public methods (0)

No public methods.

New fields (2)
  • default_code Char
    compute='_compute_default_code' inverse='_inverse_default_code' readonly=False store=True
  • manual_code Boolean
    default=False string='Manual Reference'
Public methods (0)

No public methods.

New fields (3)
  • code_prefix Char
    help='Add prefix to product variant reference (default code)' string='Reference Prefix'
  • reference_mask Char
    compute='_compute_reference_mask' copy=False help='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=True string='Variant reference mask'
  • variant_default_code_error Text
    compute='_compute_variant_default_code_error'
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
  • is_automask(self)

New fields (2)
  • group_product_default_code_manual_mask Boolean
    default=False help='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_code Boolean
    config_parameter='product_variant_default_code.prefix_as_default_code' default=False string='Reference Prefix as default Reference'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/product-variant
GIT
GIThttps://github.com/OCA/product-variant.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/product-variant/tree/15.0/product_variant_default_code
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYProduct
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Akretion, AvancOSC, Shine IT
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Akretion, AvancOSC, Shine IT
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, David, oca-ci, pilarvargas-tecnativa
WEBSITE
WEBSITEhttps://github.com/OCA/product-variant
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:46:35
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (7)
XML IDNameModelTypeStatus
attribute_tree_view product.attribute field Inherits product.attribute_tree_view
product_normal_form_view product.product field Inherits product.product_normal_form_view
product_template_only_form_view product.template field Inherits product.product_template_only_form_view
product_variant_easy_edit_view product.product field Inherits product.product_variant_easy_edit_view
view_general_configuration res.config.settings xpath Inherits base_setup.res_config_settings_view_form
view_product_attribute_form product.attribute field Inherits product.product_attribute_view_form
view_product_attribute_search product.attribute search New
Models touched (5)

New fields (1)
  • code Char
    string='Attribute Code'
Public methods (0)

No public methods.

New fields (1)
  • code Char
    compute='_compute_code' readonly=False store=True string='Attribute Value Code'
Public methods (0)

No public methods.

New fields (2)
  • default_code Char
    compute='_compute_default_code' inverse='_inverse_default_code' readonly=False store=True
  • manual_code Boolean
    default=False string='Manual Reference'
Public methods (0)

No public methods.

New fields (3)
  • code_prefix Char
    help='Add prefix to product variant reference (default code)' string='Reference Prefix'
  • reference_mask Char
    compute='_compute_reference_mask' copy=False help='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=True string='Variant reference mask'
  • variant_default_code_error Text
    compute='_compute_variant_default_code_error'
Public methods (2)
  • create(self, vals)
    @api.model
  • is_automask(self)

New fields (2)
  • group_product_default_code_manual_mask Boolean
    default=False help='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_code Boolean
    config_parameter='product_variant_default_code.prefix_as_default_code' default=False string='Reference Prefix as default Reference'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/product-variant
GIT
GIThttps://github.com/OCA/product-variant.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/product-variant/tree/14.0/product_variant_default_code
VERSION
VERSION 3.0.4
CATEGORY
CATEGORYProduct
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Akretion, AvancOSC, Shine IT
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Akretion, AvancOSC, Shine IT
COMMITTERS
COMMITTERSPedro M. Baeza, GitHub, david, OCA Transbot, João Marques, Sébastien BEAU, oca-travis, Weblate, OCA-git-bot, pilarvargas-tecnativa, Kevin.roche, Ilyas, oca-git-bot, RabbitJon-S73
WEBSITE
WEBSITEhttps://github.com/OCA/product-variant
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:41:01
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (7)
XML IDNameModelTypeStatus
attribute_tree_view product.attribute field Inherits product.attribute_tree_view
product_normal_form_view product.product field Inherits product.product_normal_form_view
product_template_only_form_view product.template field Inherits product.product_template_only_form_view
product_variant_easy_edit_view product.product field Inherits product.product_variant_easy_edit_view
view_general_configuration res.config.settings xpath Inherits base_setup.res_config_settings_view_form
view_product_attribute_form product.attribute field Inherits product.product_attribute_view_form
view_product_attribute_search product.attribute search New
Models touched (5)

New fields (1)
  • code Char
    string='Attribute Code'
Public methods (0)

No public methods.

New fields (1)
  • code Char
    compute='_compute_code' readonly=False store=True string='Attribute Value Code'
Public methods (0)

No public methods.

New fields (2)
  • default_code Char
    compute='_compute_default_code' inverse='_inverse_default_code' readonly=False store=True
  • manual_code Boolean
    default=False string='Manual Reference'
Public methods (0)

No public methods.

New fields (3)
  • code_prefix Char
    help='Add prefix to product variant reference (default code)' string='Reference Prefix'
  • reference_mask Char
    compute='_compute_reference_mask' copy=False help='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=True string='Variant reference mask'
  • variant_default_code_error Text
    compute='_compute_variant_default_code_error'
Public methods (2)
  • create(self, vals)
    @api.model
  • is_automask(self)

New fields (2)
  • group_product_default_code_manual_mask Boolean
    default=False help='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_code Boolean
    config_parameter='product_variant_default_code.prefix_as_default_code' default=False string='Reference Prefix as default Reference'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/product-variant
GIT
GIThttps://github.com/OCA/product-variant.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/product-variant/tree/13.0/product_variant_default_code
VERSION
VERSION 1.1.0
CATEGORY
CATEGORYProduct
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), AvancOSC, Shine IT
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), AvancOSC, Shine IT
COMMITTERS
COMMITTERSPedro M. Baeza, OCA Transbot, João Marques, oca-travis, Weblate, OCA-git-bot, Simone Orsi, Rad0van
WEBSITE
WEBSITEhttps://github.com/OCA/product-variant
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:34:14
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (7)
XML IDNameModelTypeStatus
attribute_tree_view product.attribute field Inherits product.attribute_tree_view
product_normal_form_view product.product field Inherits product.product_normal_form_view
product_template_only_form_view product.template field Inherits product.product_template_only_form_view
product_variant_easy_edit_view product.product field Inherits product.product_variant_easy_edit_view
view_general_configuration res.config.settings xpath Inherits base_setup.res_config_settings_view_form
view_product_attribute_form product.attribute xpath Inherits product.product_attribute_view_form
view_product_attribute_search product.attribute search New
Models touched (5)

New fields (1)
  • code Char
    string='Attribute Code'
Public methods (1)
  • write(self, vals)

New fields (1)
  • code Char
    default=onchange_name string='Attribute Value Code'
Public methods (3)
  • create(self, vals)
    @api.model
  • onchange_name(self)
    @api.onchange('name')
  • write(self, vals)

New fields (1)
  • manual_code Boolean
    string='Manual Reference'
Public methods (2)
  • create(self, vals)
    @api.model
  • onchange_default_code(self)
    @api.onchange('default_code')

New fields (2)
  • code_prefix Char
    help='Add prefix to product variant reference (default code)' string='Reference Prefix'
  • reference_mask Char
    copy=False help='Reference mask for building internal references of a variant generated from this template.\nExample:\nA product named ABC with 2 attributes: Size(S) and Color(C):\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 `Cr-Sl` `Cb-Sl` `Cr-Sx` ...\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/Sl~Cr~Sl` (for variant with Color "Red" and Size "L") `fancyA/Sx~Cy~Sx` (for variant with Color "Yellow" and Size "XL")\nNote: make sure characters "[,]" do not appear in your attribute name' string='Variant reference mask'
Public methods (2)
  • create(self, vals)
    @api.model
  • write(self, vals)

New fields (1)
  • group_product_default_code_manual_mask Boolean
    default=False help='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'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/product-variant
GIT
GIThttps://github.com/OCA/product-variant.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/product-variant/tree/12.0/product_variant_default_code
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYProduct
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), AvancOSC, Shine IT
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), AvancOSC, Shine IT
COMMITTERS
COMMITTERSOCA Transbot, Ernesto Tejeda, oca-travis, Weblate, OCA-git-bot, Oihane Crucelaegui, Mikel Arregi
WEBSITE
WEBSITEhttps://odoo-community.org/
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:29:19
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - product
    - base
    - decimal_precision
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (8)
XML IDNameModelTypeStatus
attribute_tree_view product.attribute field Inherits product.attribute_tree_view
product_normal_form_view product.product field Inherits product.product_normal_form_view
product_template_only_form_view product.template field Inherits product.product_template_only_form_view
product_variant_easy_edit_view product.product field Inherits product.product_variant_easy_edit_view
variants_tree_view_inh_variantdefaultcode variants.tree.view.inh.variantdefaultcode product.attribute.value field Inherits product.variants_tree_view
view_general_configuration res.config.settings xpath Inherits base_setup.res_config_settings_view_form
view_product_attribute_form product.attribute xpath Inherits product.product_attribute_view_form
view_product_attribute_search product.attribute search New
Models touched (5)

New fields (1)
  • code Char
    string='Attribute Code'
Public methods (1)
  • write(self, vals)

New fields (1)
  • code Char
    default=onchange_name oldname='attribute_code' string='Attribute Value Code'
Public methods (3)
  • create(self, vals)
    @api.model
  • onchange_name(self)
    @api.onchange('name')
  • write(self, vals)

New fields (1)
  • manual_code Boolean
    string='Manual Reference'
Public methods (2)
  • create(self, vals)
    @api.model
  • onchange_default_code(self)
    @api.onchange('default_code')

New fields (2)
  • code_prefix Char
    help='Add prefix to product variant reference (default code)' oldname='prefix_code' string='Reference Prefix'
  • reference_mask Char
    copy=False help='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' string='Variant reference mask'
Public methods (2)
  • create(self, vals)
    @api.model
  • write(self, vals)

New fields (1)
  • group_product_default_code Selection
    help='Set behaviour of codes (depends on variant use: see Sales/Purchases configuration)' implied_group='product_variant_default_code.group_product_default_code' string='Product Default Code behaviour' args: [(0, 'Automask'), (1, 'Manual Mask')]
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/product-variant
GIT
GIThttps://github.com/OCA/product-variant.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/product-variant/tree/11.0/product_variant_default_code
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYProduct
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), AvancOSC, Shine IT
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), AvancOSC, Shine IT
COMMITTERS
COMMITTERSPedro M. Baeza, GitHub, OCA Transbot, oca-travis, Weblate, OCA-git-bot, Daniel-CA
WEBSITE
WEBSITEhttps://odoo-community.org/
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:23:58
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - product
    - base
    - decimal_precision
    - mail
    - base_setup
    - web
    - bus
    - web_tour
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (8)
XML IDNameModelTypeStatus
attribute_tree_view product.attribute field Inherits product.attribute_tree_view
product_normal_form_view product.product field Inherits product.product_normal_form_view
product_template_only_form_view product.template field Inherits product.product_template_only_form_view
product_variant_easy_edit_view product.product field Inherits product.product_variant_easy_edit_view
variants_tree_view_inh_variantdefaultcode variants.tree.view.inh.variantdefaultcode product.attribute.value field Inherits product.variants_tree_view
view_general_configuration res.config.settings xpath Inherits base_setup.res_config_settings_view_form
view_product_attribute_form product.attribute xpath Inherits product.product_attribute_view_form
view_product_attribute_search product.attribute search New
Models touched (5)

New fields (1)
  • code Char
    string='Attribute Code'
Public methods (1)
  • write(self, vals)

New fields (1)
  • code Char
    default=onchange_name oldname='attribute_code' string='Attribute Value Code'
Public methods (3)
  • create(self, vals)
    @api.model
  • onchange_name(self)
    @api.onchange('name')
  • write(self, vals)

New fields (1)
  • manual_code Boolean
    string='Manual Reference'
Public methods (2)
  • create(self, vals)
    @api.model
  • onchange_default_code(self)
    @api.onchange('default_code')

New fields (2)
  • code_prefix Char
    help='Add prefix to product variant reference (default code)' oldname='prefix_code' string='Reference Prefix'
  • reference_mask Char
    copy=False help='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' string='Variant reference mask'
Public methods (2)
  • create(self, vals)
    @api.model
  • write(self, vals)

New fields (1)
  • group_product_default_code Selection
    help='Set behaviour of codes (depends on variant use: see Sales/Inventory configuration)' implied_group='product_variant_default_code.group_product_default_code' string='Product Default Code behaviour' args: [(0, 'Automask'), (1, 'Manual Mask')]
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/product-variant
GIT
GIThttps://github.com/OCA/product-variant.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/product-variant/tree/10.0/product_variant_default_code
VERSION
VERSION 1.0.3
CATEGORY
CATEGORYProduct
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), AvancOSC, Shine IT
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), AvancOSC, Shine IT
COMMITTERS
COMMITTERSPedro M. Baeza, GitHub, OCA Transbot, oca-travis, Weblate, OCA-git-bot, Pierrick Brun, David Vidal
WEBSITE
WEBSITEhttps://odoo-community.org/
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:19:57
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - product
    - base
    - decimal_precision
    - mail
    - base_setup
    - web_kanban
    - web
    - bus
    - web_tour
    - report
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (7)
XML IDNameModelTypeStatus
attribute_tree_view product.attribute field Inherits product.attribute_tree_view
product_normal_form_view product.product field Inherits product.product_normal_form_view
product_template_only_form_view product.template field Inherits product.product_template_only_form_view
product_variant_easy_edit_view product.product field Inherits product.product_variant_easy_edit_view
variants_tree_view_inh_variantdefaultcode variants.tree.view.inh.variantdefaultcode product.attribute.value field Inherits product.variants_tree_view
view_general_configuration base.config.settings group Inherits base_setup.view_general_configuration
view_product_attribute_search product.attribute search New
Models touched (5)

New fields (1)
  • group_product_default_code Selection
    help='Set behaviour of codes (depends on variant use: see Sales/Purchases configuration)' implied_group='product_variant_default_code.group_product_default_code' string='Product Default Code behaviour' args: [(0, 'Automask'), (1, 'Manual Mask')]
Public methods (0)

No public methods.

New fields (1)
  • code Char
    string='Attribute Code'
Public methods (1)
  • write(self, vals)

New fields (1)
  • code Char
    default=onchange_name oldname='attribute_code' string='Attribute Value Code'
Public methods (3)
  • create(self, vals)
    @api.model
  • onchange_name(self)
    @api.onchange('name')
  • write(self, vals)

New fields (1)
  • manual_code Boolean
    string='Manual Reference'
Public methods (4)
  • create(self, vals)
    @api.model
  • onchange_default_code(self)
    @api.onchange('default_code')
  • render_default_code(self)
  • write(self, vals)

New fields (2)
  • code_prefix Char
    help='Add prefix to product variant reference (default code)' oldname='prefix_code' string='Reference Prefix'
  • reference_mask Char
    copy=False help='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' string='Variant reference mask'
Public methods (3)
  • create(self, vals)
    @api.model
  • onchange_reference_mask(self)
    @api.onchange('reference_mask')
  • write(self, vals)