Saturday, April 19, 2025
1 change
New functionality added to Odoo
Adds tools for employees to create fields whose values are generated by AI from existing record information, such as summaries, classifications, sentiment, or lead assignment suggestions. It also lets Studio users configure these AI fields and enables automated server actions that update records using AI prompts, helping reduce manual data entry and standardize decisions.
Original PR description
Purpose: --------- Add AI Fields, AI Property Fields and AI server actions, computed by a LLM based on a prompt. The goal is to allow internal users to configure fields whose values are automatically…
Purpose: --------- Add AI Fields, AI Property Fields and AI server actions, computed by a LLM based on a prompt. The goal is to allow internal users to configure fields whose values are automatically generated or server actions that will update records based on existing record data. Users can reference other fields in the prompt widget using the "/field" command, and other records for relational fields (M2O/M2M) to suggest possible values using the "/record" command. Some use cases include: - Auto-assigning leads to the most suitable salesperson - Performing sentiment analysis on received messages - Generating classifications or summaries Technical: ---------- #### Fields: - Supports ai fields (added manually or using the "ai" attribute in the field definition) and ai properties fields (new option in the property definition editor popover). - Manual computation is available via an "AI" button next to each field in form views. - Prompts are parsed and processed with access to QWeb expressions. Only admins and members of "mail.group_mail_template_editor" can use unrestricted fields. Other users are limited to safe QWeb expressions. - On creation of a new ai field/ai property, we compute the field/property values for existing records using an ai_domain (id > "last id" - 50). - Crons are provided for computing fields/properties on record, ai field or ai property creation or on property definition change: - For ai fields, only NULL textual fields (`char`, `text`, `html`) are processed. We skip non-text fields to avoid overwriting falsy values. An empty string will be written if no answer is returned. - For ai properties, all property types (except separators) for which the key is not present in the properties field are processed. A falsy value is written if no answer is returned. - No dependency tracking is implemented: prompts are not recomputed if referenced fields change after creation. - AI fields can be added from studio, by dragging the new "AI Field" component from the sidebar into the view. #### Server Actions: Adds a new type of server actions, "Update With AI". This new type of actions update a record field (like the standard "Update" actions), but using a prompt instead of code. Task-4526274