ai*
This commit is contained in:
231
ai_agentic/views/ai_agent_views.xml
Normal file
231
ai_agentic/views/ai_agent_views.xml
Normal file
@@ -0,0 +1,231 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="ai_agent_view_kanban" model="ir.ui.view">
|
||||
<field name="name">ai.agent.kanban</field>
|
||||
<field name="model">ai.agent</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban action="open_agent_chat"
|
||||
type="object"
|
||||
on_create="ai_agentic.ai_agent_action_create"
|
||||
sample="1"
|
||||
class="o_ai_agent_kanban o_ai_agent_kanban_main"
|
||||
default_order="sequence">
|
||||
<field name="id"/>
|
||||
<field name="name"/>
|
||||
<field name="subtitle"/>
|
||||
<field name="image_128"/>
|
||||
<field name="custom_skill_ids"/>
|
||||
<field name="active"/>
|
||||
<field name="is_system_agent"/>
|
||||
|
||||
<templates>
|
||||
<t t-name="menu" groups="base.group_system">
|
||||
<a role="menuitem" type="archive" class="dropdown-item" t-if="widget.editable and record.active.raw_value"><i class="oi me-1" role="img" data-icon="archive"/>Archive</a>
|
||||
<a role="menuitem" type="unarchive" class="dropdown-item" t-if="widget.editable and !record.active.raw_value"><i class="oi me-1" role="img" data-icon="unarchive"/>Unarchive</a>
|
||||
<t t-if="widget.deletable and !record.is_system_agent.raw_value">
|
||||
<a role="menuitem" type="delete" class="dropdown-item text-danger"><i class="oi me-1" role="img" data-icon="delete"/>Delete</a>
|
||||
</t>
|
||||
</t>
|
||||
<t t-name="card">
|
||||
<widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
|
||||
<div class="d-flex">
|
||||
<aside>
|
||||
<field name="image_128" widget="image" alt="Agent" class="rounded"/>
|
||||
</aside>
|
||||
<main class="ms-2" style="padding-top: 10px;">
|
||||
<h4 style="margin-bottom: 2px;">
|
||||
<field name="name"/>
|
||||
</h4>
|
||||
</main>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
<field name="subtitle" class="text-muted"/>
|
||||
<field name="custom_skill_ids" widget="many2many_tags" readonly="True" class="mt-2"/>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_agent_action_create" model="ir.actions.server">
|
||||
<field name="name">Create Agent</field>
|
||||
<field name="model_id" ref="ai.model_ai_agent"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.action_create_agent()</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_agent_view_tree" model="ir.ui.view">
|
||||
<field name="name">ai.agent.list</field>
|
||||
<field name="model">ai.agent</field>
|
||||
<field name="arch" type="xml">
|
||||
<list string="Properties" js_class="ai_agent_list" action="open_agent_chat" type="object" edit="0">
|
||||
<field name="avatar_128" widget="image" options="{'size': [24, 24], 'img_class': 'o_avatar rounded'}" width="30" nolabel="1"/>
|
||||
<field name="name" string="Name"/>
|
||||
<field name="subtitle"/>
|
||||
<field name="custom_skill_ids" string="Skills" widget="many2many_tags"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_agent_view_form" model="ir.ui.view">
|
||||
<field name="name">ai.agent.form</field>
|
||||
<field name="model">ai.agent</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<field name="active" invisible="1"/> <!-- used by the agent panel menu -->
|
||||
<field name="is_system_agent" invisible="1"/> <!-- used by the agent panel menu -->
|
||||
<field name="image_128" widget="image" class="oe_avatar"/>
|
||||
<div class="oe_title">
|
||||
<h1><field name="name" placeholder="e.g. SDR Advisor"/></h1>
|
||||
<field name="subtitle" placeholder="e.g. Get tips to close more sales"/>
|
||||
</div>
|
||||
<notebook>
|
||||
<page string="Instructions">
|
||||
<field name="system_prompt"/>
|
||||
<field name="system_prompt_rendered" invisible="1"/> <!-- displayed by the agent panel instead of the raw Markdown -->
|
||||
</page>
|
||||
<page string="Skills">
|
||||
<group string="Tools">
|
||||
<field name="allowed_agent_ids" widget="many2many_tags"/>
|
||||
<field
|
||||
name="skill_ids"
|
||||
widget="many2many_checkboxes"
|
||||
domain="[('is_native_skill', '=', True)]"
|
||||
nolabel="1"
|
||||
/>
|
||||
</group>
|
||||
<field
|
||||
name="custom_skill_ids"
|
||||
widget="ai_agent_panel_skill_x2many"
|
||||
mode="list"
|
||||
domain="[('is_native_skill', '=', False)]"
|
||||
>
|
||||
<list create="1" edit="1" delete="1" limit="20">
|
||||
<field name="name"/>
|
||||
</list>
|
||||
</field>
|
||||
<field
|
||||
name="allowed_agent_ids"
|
||||
widget="ai_agent_panel_agent_x2many"
|
||||
mode="list"
|
||||
domain="[('id', '!=', id)]"
|
||||
>
|
||||
<list create="1" edit="1" delete="1" limit="20">
|
||||
<field name="id"/> <!-- To retrieve the avatar source URL-->
|
||||
<field name="name"/>
|
||||
<field name="subtitle"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Sources">
|
||||
<group>
|
||||
<field name="restrict_to_sources"/>
|
||||
</group>
|
||||
<field
|
||||
name="sources_ids"
|
||||
widget="ai_agent_panel_source_x2many"
|
||||
mode="list"
|
||||
>
|
||||
<list create="1" edit="0" delete="1">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="mimetype"/>
|
||||
<field name="is_folder"/>
|
||||
<field name="file_sources_count"/>
|
||||
<field name="is_active"/>
|
||||
<field name="status"/>
|
||||
<field name="error_details"/>
|
||||
<field name="user_has_access"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Triggers">
|
||||
<field
|
||||
name="automation_ids"
|
||||
widget="ai_agent_panel_trigger_x2many"
|
||||
mode="list"
|
||||
readonly="1"
|
||||
>
|
||||
<list create="0" edit="0" delete="0" limit="20">
|
||||
<field name="id" invisible="1"/> <!-- used by the view widget to perform ORM operations on the automation -->
|
||||
<field name="model_name" invisible="1"/> <!-- used by the view widget to conditionally render parts of the component (the "Run" button) -->
|
||||
<field name="name"/>
|
||||
<field name="active"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_agent_view_search" model="ir.ui.view">
|
||||
<field name="name">ai.agent.search</field>
|
||||
<field name="model">ai.agent</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name" string="Agent" filter_domain="['|', ('name','ilike',self), ('subtitle','ilike',self)]"/>
|
||||
<field name="system_prompt"/>
|
||||
<field name="sources_ids"
|
||||
string="Sources"
|
||||
filter_domain="[
|
||||
'|', '|',
|
||||
('sources_ids.name','ilike',self),
|
||||
('sources_ids.attachment_id.name','ilike',self),
|
||||
('sources_ids.web_page_id.url','ilike',self)]"/>
|
||||
<filter name="filter_is_archived" string="Archived" domain="[('active', '=', False)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_agent_action" model="ir.actions.act_window">
|
||||
<field name="name">Agents</field>
|
||||
<field name="res_model">ai.agent</field>
|
||||
<field name="view_mode">kanban,list,form</field>
|
||||
<field name="search_view_id" ref="ai_agent_view_search"/>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Create your first Agent!
|
||||
</p>
|
||||
<p>
|
||||
Agents help you manage and organize your AI operations.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_tool_view_search" model="ir.ui.view">
|
||||
<field name="name">ir.actions.server.ai.tool.search</field>
|
||||
<field name="model">ir.actions.server</field>
|
||||
<field name="inherit_id" ref="base.view_server_action_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<filter string="Use in AI is set" name="ai_tools" domain="[('use_in_ai', '=', True)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_tool_action" model="ir.actions.act_window">
|
||||
<field name="name">Tools</field>
|
||||
<field name="res_model">ir.actions.server</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="view_id" ref="base.view_server_action_tree" />
|
||||
<field name="search_view_id" ref="ai_tool_view_search" />
|
||||
<field name="context">{
|
||||
'default_use_in_ai': True,
|
||||
'allow_use_in_ai_edit': True,
|
||||
'search_default_ai_tools': 1,
|
||||
}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No Tools found!
|
||||
</p>
|
||||
<p>
|
||||
Tools are the specific actions an AI agent can take in your database (like
|
||||
generating an image or updating a record) when called by an Agent.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
120
ai_agentic/views/ai_composer_views.xml
Normal file
120
ai_agentic/views/ai_composer_views.xml
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="ai_composer_form" model="ir.ui.view">
|
||||
<field name="name">ai.composer.form</field>
|
||||
<field name="model">ai.composer</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name" string="Rule Name"/>
|
||||
<h2>
|
||||
<field name="name" readonly="is_system_default" placeholder="Mail Template extra prompt"/>
|
||||
</h2>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="interface_key" readonly="is_system_default" string="When users need to" placeholder="Select an action... "/>
|
||||
</group>
|
||||
<group invisible="hide_model_selection">
|
||||
<label for="focused_model_id" string="On the Model"/>
|
||||
<field name="focused_model_id" readonly="is_system_default" placeholder="All Models" nolabel="1" invisible="is_system_default and not focused_model_id or interface_key == 'systray_ai_button'"/>
|
||||
<span class="text-muted" invisible="(not is_system_default or focused_model_id) and interface_key != 'systray_ai_button'">All Models</span>
|
||||
</group>
|
||||
<group>
|
||||
<field name="ai_agent_id" widget="many2one_avatar" options="{'no_create': True}" string="Call the Agent"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="default_prompt" placeholder="Write your prompt..."/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page name="user_prompts_page" string="Buttons" invisible="hide_prompt_button_page">
|
||||
<field name="available_prompt_ids" mode="list">
|
||||
<list open_form_view="False">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_composer_tree" model="ir.ui.view">
|
||||
<field name="name">ai.composer.list</field>
|
||||
<field name="model">ai.composer</field>
|
||||
<field name="arch" type="xml">
|
||||
<list string="Default Prompts">
|
||||
<field name="name" readonly="1" string="Name"/>
|
||||
<field name="interface_key"/>
|
||||
<field name="focused_model_id" optional="hide"/>
|
||||
<field name="ai_agent_id" widget="many2one_avatar"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_composer_kanban" model="ir.ui.view">
|
||||
<field name="name">ai.composer.kanban</field>
|
||||
<field name="model">ai.composer</field>
|
||||
<field name="priority">10</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban>
|
||||
<templates>
|
||||
<t t-name="card">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<field name="name" class="fw-bolder" string="Name"/>
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
<field name="ai_agent_id" widget="many2one_avatar"/>
|
||||
<field name="ai_agent_id"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<field name="interface_key"/>
|
||||
<field name="focused_model_id"/>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_composer_view_search" model="ir.ui.view">
|
||||
<field name="name">ai.composer.view.search</field>
|
||||
<field name="model">ai.composer</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name"/>
|
||||
<field name="interface_key"/>
|
||||
<field name="focused_model_id"/>
|
||||
<field name="ai_agent_id"/>
|
||||
<filter name="filter_is_system_rule" string="System Rules"
|
||||
domain="[('is_system_default', '=', True)]"/>
|
||||
<filter name="filter_is_custom_rule" string="Custom Rules"
|
||||
domain="[('is_system_default', '=', False)]"/>
|
||||
<filter name="group_by_key" string="Key" context="{'group_by': 'interface_key'}"/>
|
||||
<filter name="group_by_models" context="{'group_by': 'focused_model_id'}"/>
|
||||
<filter name="group_by_agent" context="{'group_by': 'ai_agent_id'}"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_composer_action" model="ir.actions.act_window">
|
||||
<field name="name">Default Prompts</field>
|
||||
<field name="res_model">ai.composer</field>
|
||||
<field name="view_id" ref="ai_composer_tree"/>
|
||||
<field name="view_mode">list,kanban,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No Default Prompts found!
|
||||
</p>
|
||||
<p>
|
||||
Those are used to configure when to call a specific agent, or to add an extra prompt to your request.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
11
ai_agentic/views/ai_menus.xml
Normal file
11
ai_agentic/views/ai_menus.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<menuitem id="ai_menu_root" name="AI" web_icon="ai_agentic,static/description/icon.png" groups="base.group_user_regular" sequence="50">
|
||||
<menuitem id="ai_agent_menu_action" name="Agents" action="ai_agent_action" sequence="30"/>
|
||||
<menuitem id="ai_config_menu" name="Configuration" sequence="50">
|
||||
<menuitem id="ai_skill_menu_action" name="Skills" action="ai_skill_action" sequence="15"/>
|
||||
<menuitem id="ai_tool_menu_action" name="Tools" action="ai_tool_action" groups="base.group_system" sequence="16"/>
|
||||
<menuitem id="menu_ai_composer" name="Default Prompts" action="ai_composer_action" groups="base.group_system" sequence="20"/>
|
||||
</menuitem>
|
||||
</menuitem>
|
||||
</odoo>
|
||||
46
ai_agentic/views/ai_prompt_button_views.xml
Normal file
46
ai_agentic/views/ai_prompt_button_views.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="ai_prompt_button_view_form" model="ir.ui.view">
|
||||
<field name="name">ai.prompt.button.view.form</field>
|
||||
<field name="model">ai.prompt.button</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<group>
|
||||
<label for="name" string="Title" colspan="2"/>
|
||||
<field name="name" nolabel="1" placeholder="Summarize the chatter" colspan="2"/>
|
||||
</group>
|
||||
<group>
|
||||
<label for="prompt" string="Prompt" colspan="2"/>
|
||||
<field
|
||||
name="prompt"
|
||||
nolabel="1"
|
||||
colspan="2"
|
||||
options="{
|
||||
'height': 200,
|
||||
'resizable': true,
|
||||
'aiFieldSelectorModelReferenceField': 'render_model'
|
||||
}"
|
||||
widget='ai_field_selector_html_field'
|
||||
invisible="not render_model"
|
||||
class="border"
|
||||
placeholder="e.g. write a one paragraph summary of the chatter conversation"
|
||||
/>
|
||||
<field
|
||||
name="prompt"
|
||||
nolabel="1"
|
||||
colspan="2"
|
||||
options="{
|
||||
'height': 200,
|
||||
'resizable': true,
|
||||
}"
|
||||
invisible="render_model"
|
||||
class="border"
|
||||
placeholder="e.g. write a one paragraph summary of the chatter conversation"
|
||||
/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
85
ai_agentic/views/ai_skill_views.xml
Normal file
85
ai_agentic/views/ai_skill_views.xml
Normal file
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="ai_skill_view_search" model="ir.ui.view">
|
||||
<field name="name">ai.skill.view.search</field>
|
||||
<field name="model">ai.skill</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name" string="Skill" filter_domain="['|', ('name', 'ilike', self), ('description', 'ilike', self)]"/>
|
||||
<field name="instructions"/>
|
||||
<field name="tool_ids"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_skill_view_form" model="ir.ui.view">
|
||||
<field name="name">ai.skill.form</field>
|
||||
<field name="model">ai.skill</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet class="o_ai_skill_form">
|
||||
<div class="oe_title mb-4">
|
||||
<div>
|
||||
<label for="name"/>
|
||||
<h1 class="mb-0">
|
||||
<field name="name" placeholder="e.g. Chat with customers"/>
|
||||
</h1>
|
||||
<h4>
|
||||
<field name="description" options="{'line_breaks': 0}" placeholder="Summarize what this skill does"/>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<group>
|
||||
<field name="instructions" placeholder="Explain to the Agent what they need to do..."/>
|
||||
<field name="tool_ids" widget="many2many_tags" options="{'no_quick_create': True, 'on_tag_click': 'open_form'}"
|
||||
context="{'default_use_in_ai': True}"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_skill_view_list" model="ir.ui.view">
|
||||
<field name="name">ai.skill.list</field>
|
||||
<field name="model">ai.skill</field>
|
||||
<field name="arch" type="xml">
|
||||
<list>
|
||||
<field name="name" string="Title" class="fw-bold"/>
|
||||
<field name="description" class="text-muted"/>
|
||||
<field name="tool_ids" string="AI Tools" widget="many2many_tags" optional="hide"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_skill_view_kanban" model="ir.ui.view">
|
||||
<field name="name">ai.skill.kanban</field>
|
||||
<field name="model">ai.skill</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_ai_agent_kanban">
|
||||
<templates>
|
||||
<t t-name="card">
|
||||
<field name="name" class="fw-bold fs-5"/>
|
||||
<field name="description"/>
|
||||
<field name="tool_ids"/>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_skill_action" model="ir.actions.act_window">
|
||||
<field name="name">Skills</field>
|
||||
<field name="res_model">ai.skill</field>
|
||||
<field name="view_mode">list,kanban,form</field>
|
||||
<field name="domain">[('is_native_skill', '=', False)]</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Create your first skill!
|
||||
</p>
|
||||
<p>
|
||||
Skills help you manage and organize your AI operations.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
51
ai_agentic/views/base_automation_views.xml
Normal file
51
ai_agentic/views/base_automation_views.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<record id="base_automation_view_form_inherit_ai" model="ir.ui.view">
|
||||
<field name="name">base.automation.form.inherit.ai</field>
|
||||
<field name="model">base.automation</field>
|
||||
<field name="inherit_id" ref="base_automation.view_base_automation_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook" position="before">
|
||||
<group invisible="not model_id">
|
||||
<field name="ai_agent_id"
|
||||
widget="many2one_avatar"
|
||||
options="{'no_create': True, 'no_create_edit': True, 'no_open': True}"/>
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='trg_date_id']" position="attributes">
|
||||
<attribute name="readonly">ai_agent_id and model_name == 'ai.automation.trigger' and trigger == 'on_time'</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//label[@for='trg_date_range']" position="attributes">
|
||||
<attribute name="invisible" add="ai_agent_id and model_name == 'ai.automation.trigger' and trigger == 'on_time'" separator="or"/>
|
||||
</xpath>
|
||||
<xpath expr="//label[@for='trg_date_range']" position="after">
|
||||
<label for="trg_date_range" invisible="not (ai_agent_id and model_name == 'ai.automation.trigger' and trigger == 'on_time')" string="Interval"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='trg_date_range_mode']" position="attributes">
|
||||
<attribute name="invisible" add="ai_agent_id and model_name == 'ai.automation.trigger' and trigger == 'on_time'" separator="or"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='trg_date_range']/.." position="after">
|
||||
<label for="ai_next_trigger_date" string="Next Trigger Date"
|
||||
invisible="model_name != 'ai.automation.trigger' or trigger != 'on_time'"/>
|
||||
<div invisible="model_name != 'ai.automation.trigger' or trigger != 'on_time'">
|
||||
<field name="ai_next_trigger_date" class="oe_inline"
|
||||
required="model_name == 'ai.automation.trigger' and trigger == 'on_time'"/>
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='actions']" position="attributes">
|
||||
<attribute name="invisible">ai_agent_id</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='actions']" position="after">
|
||||
<page string="Prompt" name="ai_action_prompt" invisible="not ai_agent_id">
|
||||
<group>
|
||||
<field name="ai_action_prompt"
|
||||
string="Instructions"
|
||||
widget="ai_prompt"
|
||||
options="{'model_reference_field': 'model_name'}"
|
||||
required="ai_agent_id"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
27
ai_agentic/views/ir_actions_server_views.xml
Normal file
27
ai_agentic/views/ir_actions_server_views.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<!-- default priority: applies before `ai`'s form inherit (priority 20), so
|
||||
the Actions page stays left of the AI Prompt one -->
|
||||
<record id="ir_actions_server_view_form" model="ir.ui.view">
|
||||
<field name="name">ir.actions.server.view.form.inherit.ai.agentic</field>
|
||||
<field name="model">ir.actions.server</field>
|
||||
<field name="inherit_id" ref="base.view_server_action_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<!-- the multi-action steps belong in their own page, next to
|
||||
Explanation, like on the scheduled action form -->
|
||||
<xpath expr="//field[@name='child_ids']/.." position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='explanation']" position="before">
|
||||
<page string="Actions" name="multi_actions" invisible="state != 'multi'">
|
||||
<field name="child_ids" widget="many2many" mode="kanban" context="{
|
||||
'is_modal': 1,
|
||||
'default_model_id': model_id,
|
||||
}"/>
|
||||
</page>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user