Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Customizations
  3. OS AI Computed Fields v 16.0
  4. Sales Conditions FAQ

OS AI Computed Fields

by Alain Bloos https://github.com/alainbloos/odoo_os_ai
Odoo
v 16.0 Third Party 6
Download for v 16.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Community Apps Dependencies Show
OS AI Base
Lines of code 1840
Technical Name os_ai_fields
LicenseLGPL-3
Websitehttps://github.com/alainbloos/odoo_os_ai
Versions 15.0 16.0 17.0 18.0 19.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Community Apps Dependencies Show
OS AI Base
Lines of code 1840
Technical Name os_ai_fields
LicenseLGPL-3
Websitehttps://github.com/alainbloos/odoo_os_ai
Versions 15.0 16.0 17.0 18.0 19.0

Overview

OS AI Computed Fields adds an ai_compute parameter to every Odoo field type. Write a prompt, declare dependencies, and the field is automatically computed by an LLM — just like native compute, but powered by AI.

Fields are processed asynchronously by a background cron job (or synchronously on save), with batch processing, automatic capability routing, and full logging.

Quick Example

from odoo import fields, models

class SaleOrder(models.Model):
    _inherit = 'sale.order'

    ai_summary = fields.Text(
        "AI Summary",
        ai_compute="Summarize this sale order for {partner_id.name}: "
                   "lines={order_line}, total={amount_total}",
        ai_compute_depends=['partner_id', 'order_line', 'amount_total'],
        store=True,
    )

That is all the code needed. The field computes automatically whenever the dependencies change.

Features

⚙ Works on Any Odoo Field
Add ai_compute to Char, Text, Html, Integer, Float, Selection, Many2one, Many2many, Image, and Binary fields.
🕑 Async & Sync Modes
Default: asynchronous via cron (non-blocking). Set ai_compute_async=False for immediate computation on save.
📚 Batch Processing
Multiple records are processed in a single LLM call using structured JSON schemas. Configurable batch size (default: 40).
🌐 Auto-Translation
Set translate=True and the system generates values in all installed languages in a single LLM call.
👁 Vision, Image Generation & Editing
Analyze images (vision), create images from text, or transform existing images. Capability routing is automatic.
📄 PDF & Excel Document Generation
Binary fields with ai_document_type='pdf' or 'xlsx' generate downloadable documents. Uses wkhtmltopdf and openpyxl (both bundled with Odoo).
🛠 Resilient Cron
Per-batch commits, automatic rollback on errors, and auto-stop after 3 consecutive failures.

Supported Field Types

Category Field Types Notes
Text Char, Text, Html Optional translate=True for multi-language
Numeric Integer, Float LLM output parsed and validated automatically
Selection Selection LLM picks from the field's defined options
Relational Many2one, Many2many LLM receives options filtered by domain
Images Image, Binary Vision, generation, and editing
Documents Binary With ai_document_type='pdf' or 'xlsx'

Parameters

Parameter Type Default Description
ai_compute str — Prompt template with {field} placeholders
ai_compute_depends list [] Fields that trigger recomputation when changed
ai_compute_async bool True True: cron-based. False: compute on save
ai_compute_batch_size int 40 Max records per LLM call
ai_document_type str None 'pdf' or 'xlsx' for Binary fields

Prompt Placeholders

Placeholder Resolves To
{name}Value of field name on the record
{partner_id.name}Dot-notation for related fields
{order_line}One2many/Many2many display names
{image_1920}Binary/Image fields sent as base64 to vision models
{__date__}Current date (YYYY-MM-DD)
{__user__}Current user's name
{__company__}Current company's name

More Examples

Numeric scoring

ai_score = fields.Integer(
    ai_compute="Rate profile completeness 0-100: "
               "name={name}, email={email}, phone={phone}",
    ai_compute_depends=['name', 'email', 'phone'],
    store=True,
)

AI classification (Selection)

ai_type = fields.Selection(
    [('prospect', 'Prospect'),
     ('customer', 'Customer'),
     ('supplier', 'Supplier')],
    ai_compute="Classify {name}: vat={vat}, "
               "job={function}, company={parent_id.name}",
    ai_compute_depends=['name', 'vat', 'function', 'parent_id'],
    store=True,
)

Vision — describe an image

ai_description = fields.Text(
    ai_compute="Describe this photo: {image_1920}",
    ai_compute_depends=['image_1920'],
    store=True,
)

PDF and Excel documents

ai_report = fields.Binary(
    "Report (PDF)",
    ai_document_type='pdf',
    ai_compute="Generate an HTML report for {name}",
    ai_compute_depends=['name', 'email', 'phone'],
    store=True,
)

Configuration

  1. Install OS AI Base first (pulled automatically as a dependency).
  2. Configure at least one AI provider in Settings > Technical > OS AI > AI Providers (Developer Mode required).
  3. Optionally adjust the system prompt in Settings > OS AI Fields.
  4. The background cron runs every 5 minutes by default. Adjust in Settings > Technical > Automation > Scheduled Actions.

Technical Details

Technical Nameos_ai_fields
LicenseLGPL-3
Dependenciesos_ai

Demo Module

Install AI Fields Demo (os_ai_fields_demo) in a test database to see 15 working examples of AI-computed fields on the Contact form, covering text, numeric, selection, relational, image, and document field types.

Developed by Alain Bloos — GitHub

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with