Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Product Variant Default Code

Entity: product.template

Compute Method: _compute_reference_mask

Inputs Method Outputs
automask = self.is_automask()
for rec in self:
            if rec.default_code and not rec.code_prefix:
                rec.code_prefix = rec.default_code
            if automask or not rec.reference_mask:
                rec.reference_mask = rec._get_default_mask()
            elif (
                not automask
                and rec.code_prefix
                and rec.code_prefix not in rec.reference_mask
            ):
                rec.reference_mask = rec.code_prefix + rec.reference_mask

Back to entity