Sequence Mixin
Project description
Sequence Mixin
Description
Sequence Mixin is a core mixin module in the @simetri-sinergi-id/ssi-mixin technology suite for Odoo 15. It provides a configurable, reusable document-numbering framework that can be mixed into any transactional model to automatically generate document numbers (codes) based on flexible criteria and sequence templates.
The module ships two main components:
sequence.template — a master-data record that maps a model and a set of applicability criteria (Python expression or domain filter) to an ir.sequence with optional custom prefix/suffix computation.
mixin.sequence — an abstract mixin that adds _create_sequence() to auto-select the applicable template and apply the generated number to the configured field.
Key Features
Template-Based Numbering: Define multiple sequence templates per model; the first matching template is used.
Flexible Applicability: Determine which template applies via a Python expression or an Odoo domain filter.
Sequence Selection Methods: Use a standard ir.sequence or a Python expression to pick the sequence.
Custom Prefix & Suffix: Optionally compute and prepend/append dynamic strings (e.g. year, month) around the sequence number.
Date-Aware: Passes the document date to ir.sequence so date-based reset periods work correctly.
Mixin Design: Zero-intrusion — inherit mixin.sequence in any model to get the full capability.
Open Source: AGPL-3.0 license with community-driven improvements.
Use Cases / Context
Use this mixin whenever you need automatic, rule-based document numbering in a custom Odoo module:
Sales Orders / Invoices: Generate numbers like SO/2025/001 with date-based reset.
HR Documents: Different numbering sequences per department or contract type.
Multi-Company: Separate sequences per company entity.
Custom Transactional Models: Any model requiring structured reference numbers.
Simply inherit mixin.sequence, configure a Sequence Template via the menu, and call _create_sequence() at the appropriate state transition.
Installation
To install this module, you need to:
Clone branch 15.0 of the repository https://github.com/simetri-sinergi-id/ssi-mixin
Add the path to this repository in your configuration (addons-path)
Update the module list (Must be on developer mode)
Go to menu Apps → Apps → Main Apps
Search for Sequence Mixin
Install the module
Installation & Usage
After installation:
Go to Sequence → Templates to create sequence templates for your models.
In your custom model, inherit mixin.sequence:
class MyModel(models.Model): _name = "my.model" _inherit = ["mixin.sequence", "my.model"]Call self._create_sequence() at the state transition where the document number should be generated (e.g. inside action_confirm).
FAQ
Standalone? No — it is a mixin foundation. Install it as a dependency of your custom module.
Odoo Version? Odoo 15.0.
Can I have multiple templates for one model? Yes. Templates are evaluated in ascending sequence order; the first matching one wins.
Contribute? Fork, branch, and submit a pull request on GitHub.
Bug Tracker
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smash it by providing detailed and welcomed feedback.
Credits
Contributors
Michael Viriyananda <viriyananda.michael@gmail.com>
Andhitia Rama <andhitia.r@gmail.com>
Nur Azmi <azmimr67@gmail.com>
Maintainer
This module is maintained by PT. Simetri Sinergi Indonesia.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoo_addon_ssi_sequence_mixin-15.0.1.1.0-py3-none-any.whl.
File metadata
- Download URL: odoo_addon_ssi_sequence_mixin-15.0.1.1.0-py3-none-any.whl
- Upload date:
- Size: 65.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cac33fd58977898f51e355be553e948f03f43f3e12161d5c66bccd081719611
|
|
| MD5 |
30988f8d41463511dc40b016b8682429
|
|
| BLAKE2b-256 |
fc25e9f4874510ff0d31023cf8104adde461976494b0bb3570facfb3ed1755c2
|