| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 3348 |
| Technical Name |
eh_ai_fields |
| License | OPL-1 |
| Website | https://erpheritage.com.au |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 3348 |
| Technical Name |
eh_ai_fields |
| License | OPL-1 |
| Website | https://erpheritage.com.au |
AI Computed Fields
Populate any stored field on any model with AI-generated values via a rule-based engine metered against your budget.
Why this module
AI Computed Fields
Any model, any stored field
Define rules for any model in Odoo. Scope them to text fields, integers, booleans, selections, dates, currency amounts, HTML rich text, or any other stored field type you choose.
Every call is tracked and counted
Computations flow through the standard EH AI agent pipeline, so they appear in execution logs, count against your configured budgets, and are visible in spend reports.
LLM output becomes proper field values
The engine parses free-form text into the target field type. Extract integers from prose, parse dates from natural language, map text labels to selection keys, and cast yes/no to booleans.
Day in the life
Enriching partner records in real time
A sales user opens a partner form and notices the 'Industry Segment' field is empty on 20 records. They navigate to AI Fields, click 'Compute Empty Values', and in seconds the agent fills all of them by reading the partner name and description, returning classification labels. Each call is logged. A week later, the finance team queries spend reports and sees that this rule has cost 150 credits across 300 records.
Edge cases
The cases most modules quietly ignore.
In the shipped code today, each one a place where a cheaper module silently does the wrong thing.
If a record has no data in the fields you specified, the engine sends the context marker '(no data)' to the LLM. It is up to the prompt to handle this gracefully.
If a rule fails on one record (e.g., API timeout, casting error), the engine logs a warning and moves to the next record. Batch operations do not roll back on a single failure.
When mapping LLM output to a selection field, the engine first tries exact key/label match, then substring match. If the output is ambiguous, the first matching option in the field definition is returned. If no match found, the field receives False.
HTML fields receive the raw text returned by the LLM. Odoo may auto-wrap it in HTML tags on save depending on the HTML editor widget configuration.
What is inside
Built to do the job, end to end.
- Rule builder form. Name your rule, choose the model and target field, select the agent, and write a prompt. Optionally specify which fields to send as context; if you leave this empty, all simple storable fields on the model are auto-included (but no relations).
- Action buttons. Compute Empty Values fills all records where the target field is false/empty, in batches up to 200 per action. Call action_compute_for_records() from Python if you need to fill specific records or a different subset.
- Usage tracking. Every computation invokes generate_response() on the agent, which increments the usage log, applies provider costs, and updates spend totals in real time.
- Version-neutral design. The module works identically on Odoo 16, 17, 18, and 19. No version-specific overrides needed. Drop it into any branch and activate.
Honest about the edges
What this does not do, so nothing surprises you.
- Does not compute unstored (computed) fields or m2m/o2m relations
- Does not support templating or custom Jinja in prompts; the prompt is static text sent to the LLM
- Does not include a workflow trigger for field updates; you must call the action manually or wire it via an automation rule in another module
- Does not provide scheduling for recurring computations; use Odoo's native scheduled action or a parent automation if you need recurring fills
AI field population, AI computed fields, LLM field generation, automated field fill, record enrichment, Odoo AI agent, budget-aware AI, type-safe LLM output, bring your own API key, field casting
Odoo 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