| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 308 |
| Technical Name |
mjb_field_default_rule |
| License | OPL-1 |
| Website | https://www.majorbird.com |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 308 |
| Technical Name |
mjb_field_default_rule |
| License | OPL-1 |
| Website | https://www.majorbird.com |
Smart Field Default Engine
A configurable, no-code rule engine that auto-sets default values on any field of any Odoo model at record creation — without writing a single line of Python.
$49 — One-time purchase Odoo 19.0by Majorbird — Odoo Silver Partner
⚠ The Problem
Setting a default value on a field in Odoo — such as a default responsible
user, a default internal category, or a pre-filled boolean flag — normally
requires a developer to write a default= lambda,
an @api.onchange method, or override create().
For functional consultants and power users, this means raising a ticket,
waiting for development, and paying for customization that breaks on every
upgrade. There is no built-in way to define field defaults dynamically
from the Odoo UI without code.
What the Engine Does
| Feature | Description |
|---|---|
| Target any model and field | Pick any installed Odoo model and any compatible field — the engine wires the default injection automatically at record creation. |
| Fixed Value mode | Set a literal string, integer, boolean, or Many2one ID as the default. No Python required — just type the value in the form. |
| Expression mode |
Write a Python expression evaluated at create-time
(e.g. env.user.company_id.id) for dynamic defaults
that depend on context or related records.
|
| Domain filter | Restrict which records receive the default using a standard Odoo domain — apply only to records matching specific conditions. |
| No-overwrite guard | The engine only stamps the field if it is empty at create-time. Existing values set by the user are always respected. |
| Multiple rules per model | Define as many default rules as needed for the same model — each rule targets a different field independently. |
| Enable / disable toggle | Rules can be paused and reactivated without losing configuration. The underlying automated action is cleanly deactivated, not deleted. |
Key Features
No-Code Configuration
Create and manage field default rules entirely from the Odoo Settings menu. No developer, no Python files, no upgrade risk.
Fixed or Dynamic Defaults
Choose between a fixed literal value or a Python expression evaluated live at create-time — full flexibility without code.
No-Overwrite Guard
The engine never stamps a field that already has a value. User-entered data is always preserved — safe to enable on existing databases.
Domain-Scoped Rules
Restrict each rule to a subset of records using a standard Odoo domain filter — apply different defaults to different record types on the same model.
Satellite-Ready
The engine is designed as a platform. Companion satellite modules can ship pre-configured rule packs for common use cases, installable in one click.
Role-Based Access
Two security groups: User (read-only) and Manager (full CRUD). Settings administrators receive Manager access automatically.
Getting Started
Go to Settings → Technical → Field Default Rules
After installation, the menu is available to users with the Field Default Rule Manager group.
Click New — select your model and target field
Choose any installed Odoo model from the dropdown, then pick the field that should receive the default value on record creation. Optionally add a domain filter to scope the rule.
Choose Fixed Value or Expression mode
Fixed Value: type a literal string, number, boolean,
or Many2one ID to apply as the default.
Expression: write a Python expression evaluated at
create-time, e.g. env.user.company_id.id or
env.ref('base.main_company').id.
Toggle Enable — the rule is live
Flip the Enabled switch. From this point forward, every new record created on the target model will receive the configured default value — only if the field is empty at create-time.
ℹ Scope & Limitations
This module does NOT:
- Backfill existing records — only new record creation is affected
- Support Many2many or One2many fields as default targets
- Provide an onchange or UI widget — defaults are applied silently at create
- Override a field value the user has explicitly filled in
- Replace Odoo's native
default=attributes on built-in models - Execute on write or update — only on record creation
🆕 Version 19.0.1.0.1 — Feedback Welcome
This is the first stable release of the Smart Field Default Engine on Odoo 19. All core features are fully tested and functional. If you encounter any issue or have a feature request, we welcome your feedback via the Odoo Apps support system. Your input shapes the next version.
About Majorbird
Odoo Silver Partner — Manufacturing, Inventory & Accounting Automation
Offices in Vietnam, China, Mexico, and the Middle East.
www.majorbird.comOdoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module