bemade-addons/openwebui_connector/views/ai_prompt_template_views.xml
mathis ed9dda9bea [ADD] openwebui_connector, helpdesk_sale_order_ai: AI-powered sales order generation from helpdesk tickets
This commit introduces AI integration for helpdesk tickets to automatically generate sales orders:

- openwebui_connector: New module providing integration with OpenWebUI AI service
  * Configurable API connection (key, base URL, model)
  * AI prompt template system for reusable prompts
  * Uses Claude 3 Sonnet model by default

- helpdesk_sale_order_ai: Extends helpdesk_sale_order with AI capabilities
  * AI-powered analysis of ticket content to suggest products
  * Smart product quantity parsing from various formats
  * Dedicated UI tab for AI suggestions in helpdesk tickets
  * Auto-creation of sales orders with matched products

The integration streamlines the process of converting customer support requests into sales opportunities.
2025-07-15 15:18:01 -04:00

109 lines
5.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- AI Prompt Template Form View -->
<record id="view_openai_prompt_template_form" model="ir.ui.view">
<field name="name">openwebui.prompt.template.form</field>
<field name="model">openwebui.prompt.template</field>
<field name="arch" type="xml">
<form string="AI Prompt Template">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="set_as_default" type="object"
class="oe_stat_button" icon="fa-star"
invisible="is_default">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Set as Default</span>
</div>
</button>
<button name="set_as_default" type="object"
class="oe_stat_button" icon="fa-star" disabled="1"
invisible="not is_default">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Default Template</span>
</div>
</button>
</div>
<div class="oe_title">
<h1><field name="name" placeholder="Template Name"/></h1>
</div>
<group>
<group>
<field name="template_type"/>
<field name="sequence" groups="base.group_no_one"/>
<field name="active" widget="boolean_toggle"/>
<field name="is_default" invisible="1"/>
</group>
</group>
<notebook>
<page string="Template Content" name="template_content">
<div class="text-muted mb-3">
<div invisible="template_type != 'helpdesk'">
Use placeholders like {description}, {customer}, etc. to include ticket information in the prompt.
</div>
<div invisible="template_type != 'general'">
Use placeholders like {content} to include content in the prompt.
</div>
</div>
<field name="content" widget="text" class="oe_edit_only" style="min-height: 300px;"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- AI Prompt Template List View -->
<record id="view_openai_prompt_template_list" model="ir.ui.view">
<field name="name">openwebui.prompt.template.list</field>
<field name="model">openwebui.prompt.template</field>
<field name="arch" type="xml">
<list>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="template_type"/>
<field name="is_default" string="Default"/>
<field name="active" widget="boolean_toggle"/>
</list>
</field>
</record>
<!-- AI Prompt Template Search View -->
<record id="view_openai_prompt_template_search" model="ir.ui.view">
<field name="name">openwebui.prompt.template.search</field>
<field name="model">openwebui.prompt.template</field>
<field name="arch" type="xml">
<search string="Search AI Prompt Templates">
<field name="name"/>
<filter string="Default" name="default" domain="[('is_default', '=', True)]"/>
<filter string="Helpdesk" name="helpdesk" domain="[('template_type', '=', 'helpdesk')]"/>
<filter string="General" name="general" domain="[('template_type', '=', 'general')]"/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
<group expand="0" string="Group By">
<filter string="Template Type" name="group_by_type" domain="[]" context="{'group_by': 'template_type'}"/>
</group>
</search>
</field>
</record>
<!-- AI Prompt Template Action -->
<record id="action_openai_prompt_template" model="ir.actions.act_window">
<field name="name">AI Prompt Templates</field>
<field name="res_model">openwebui.prompt.template</field>
<field name="view_mode">list,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new AI prompt template
</p>
<p>
Define templates for AI prompts used in various modules.
</p>
</field>
</record>
<!-- Menu Item under Settings -->
<menuitem id="menu_openai_prompt_template"
name="AI Prompt Templates"
parent="base.menu_administration"
action="action_openai_prompt_template"
sequence="50"/>
</odoo>