This module generate code as readable for humans: not too long, random enough, without some ambiguous char like ( "O" "0", "I", "L"), not memorable, without meaning (no words), acceptable as a barcode (like code123, 123CoDe, 1code-23, ...).
auto_awesome What this module does
AI-generated from the code · Odoo 14.0Provides a reusable way to automatically generate short, human-readable codes (like barcodes) for records, avoiding confusing characters such as O, 0, I and L. Other modules can use it to fill in a code field automatically when a record is created.
This module adds a technical building block rather than a screen users work with directly. It defines a code format mixin (code.format.mixin) that other Odoo models can inherit to get an automatically generated code field.
When a record is created without a code, the module generates one for it. The code is built from a mask pattern; the default pattern is XXXXXX-00, where each X becomes a random uppercase letter and each 0 becomes a random digit. The letters I, O and lowercase i, o, plus the digits 1 and 0, are deliberately excluded so codes are easy to read and scan.
- The generated code is checked against existing records; if it already exists, a new one is generated, up to 20 attempts, after which an error is raised.
- The
codefield is tracked, so changes to it are recorded in the chatter (the module depends onmail). - The mask can be customised per model through the mixin's configuration, and the module also depends on
sale.
Access rights are granted to all internal users for the mixin model. No menus, reports or scheduled actions are added by this module; it only provides the generation logic and the code field for other modules to reuse.
Depends on
Models and fields (1)
- code.format.mixin · new modelcode
Text generated by AI (DeepSeek) from reading the Odoo 14.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 1 confirmed, 8 with no information of 9 versions.
Sources · Odoo 14.0
Confirmed on 2026-11-03 in branch 14.0 of OCA/server-tools.
terminal Installation and usage
OCA documentation · Odoo 14.0Usage
Source · Odoo 14.01/ _code_mask must be added in the related model e.g. in "gift.card": _code_mask = { "mask": "code_mask", "template": "gift_card_tmpl_id" } 2/ In the related model, You can change the code_mask value or use its default value (XXXXXX-00): x means a random lowercase letter, X means a random uppercase letter, 0 means a random digit. 3/ In addition, update a method of the target model to compute the code. For example the create method: res = super().create(vals) vals["code"] = res._generate_code()
No verified information in OCA: Installation, Configuration.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.