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

Module: Invoicing

Entity: sequence.mixin

Compute Method: _compute_split_sequence

Inputs Method Outputs
for record in self:
            sequence = record[record._sequence_field] or ''
            # make the seq the only matching group
            regex = self._make_regex_non_capturing(record._sequence_fixed_regex.replace(r"?P<seq>", ""))
            matching = re.match(regex, sequence)
            record.sequence_prefix = sequence[:matching.start(1)]
            record.sequence_number = int(matching.group(1) or 0)

Back to entity