Merge pull request !11940 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-06-06 15:07:15 +00:00
committed by Gitee
2 changed files with 66 additions and 63 deletions
+3 -3
View File
@@ -765,6 +765,7 @@ class AiConversation(models.Model):
'1. 张三 / 研发部 / 2025-03-01\n'
'2. 李四 / 财务部 / 2025-03-15\n'
'【报表与推送】当用户要求查看列表/报表/明细时,'
'只生成一个链接即可,不要生成多个链接或过多说明。\n'
'优先调用 get_report_link 工具:\n'
' 1) 从"可用报表模板"中找到匹配的 template_id\n'
' 2) 调用 get_report_link({"template_id": XX}) 获取固定链接\n'
@@ -778,9 +779,8 @@ class AiConversation(models.Model):
'报表链接只能从 get_report_link 或 generate_report 工具返回的 url 字段中获取,'
'直接用工具返回的 URL,不要做任何修改。'
'如果你自己拼一个 /ai/report/xxx 或任何自创的链接格式,用户点击后会看到"报表不存在"。\n'
'生成报表后系统会自动尝试推送到用户的企微。无论推送是否成功,'
'回复时都要说明查询结果并附上工具返回的真实链接,如:\n'
'已为您生成报表,共查询到 XX 条记录:\n'
'生成报表后系统会自动尝试推送到用户的企微。回复时保持简洁,'
'只发送一条包含链接的简短消息即可,不要添加过多说明。如:\n'
'https://oa.thtzjt.com/ai/report/xxxxxxxxxxxxxxxxxxxxxxxx\n'
'查询结果中的时间已经转换为北京时间(UTC+8),直接展示即可,无需再做时区转换。\n\n'
'【重要】你具有记忆能力。当对话中发现用户的新偏好、工作内容、习惯等值得长期记住的信息时,'
+63 -60
View File
@@ -29,7 +29,7 @@
<form string="动态报表">
<sheet>
<widget name="web_ribbon" title="已停用"
bg_color="text-bg-danger" invisible="active"/>
bg_color="text-bg-danger" invisible="active"/>
<div class="oe_title">
<h1>
@@ -40,7 +40,7 @@
<group>
<group string="查询参数">
<field name="model_id"
options="{'no_create': True}"/>
options="{'no_create': True}"/>
<field name="model_name" invisible="1"/>
<field name="domain"/>
<field name="field_list"/>
@@ -70,15 +70,15 @@
<field name="name"/>
<field name="model_name"/>
<filter name="filter_active" string="有效"
domain="[('active','=',True),('expire_date','>=', context_today().strftime('%Y-%m-%d'))]"/>
domain="[('active','=',True),('expire_date','>=', context_today().strftime('%Y-%m-%d'))]"/>
<filter name="filter_expired" string="已过期"
domain="[('expire_date','&lt;', context_today().strftime('%Y-%m-%d'))]"/>
domain="[('expire_date','&lt;', context_today().strftime('%Y-%m-%d'))]"/>
<separator/>
<group expand="0" string="分组">
<filter name="group_model" string="数据模型"
context="{'group_by': 'model_name'}"/>
context="{'group_by': 'model_name'}"/>
<filter name="group_user" string="创建人"
context="{'group_by': 'create_uid'}"/>
context="{'group_by': 'create_uid'}"/>
</group>
</search>
</field>
@@ -93,8 +93,8 @@
<!-- 菜单 → 系统配置 -->
<menuitem id="menu_ai_report" name="动态报表"
parent="menu_system_config" action="action_ai_report" sequence="4"
groups="yuthon_ai_agent.group_ai_agent_admin"/>
parent="menu_system_config" action="action_ai_report" sequence="4"
groups="yuthon_ai_agent.group_ai_agent_admin"/>
<!-- ============================================ -->
<!-- 报表模板 - 列表视图 -->
@@ -124,28 +124,28 @@
<form string="报表模板">
<sheet>
<widget name="web_ribbon" title="已停用"
bg_color="text-bg-danger" invisible="active"/>
bg_color="text-bg-danger" invisible="active"/>
<div class="oe_title">
<table style="width:100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td style="width:60%">
<h1><field name="name" placeholder="如:销售订单列表模板"/></h1>
<h1>
<field name="name" placeholder="如:销售订单列表模板"/>
</h1>
</td>
<td style="width:40%;text-align:right;vertical-align:bottom">
<div class="d-flex flex-nowrap justify-content-end gap-1">
<button name="action_generate_fixed_report" type="object"
string="生成固定链接" class="btn-secondary"
icon="fa-link"
help="生成永久有效的报表链接,每天凌晨自动刷新"/>
string="生成链接" class="btn-secondary"
help="生成永久有效的报表链接,每天凌晨自动刷新"/>
<button name="action_preview" type="object"
string="预览报表" class="oe_highlight"
invisible="not model_name"/>
string="预览报表" class="oe_highlight"
invisible="not model_name"/>
<button name="action_init_columns" type="object"
string="初始化列" class="btn-secondary"
icon="fa-magic"
invisible="not model_name"
help="从模型的 tree 视图中提取可见字段,批量生成列定义"/>
string="初始化列" class="btn-secondary"
invisible="not model_name"
help="从模型的 tree 视图中提取可见字段,批量生成列定义"/>
</div>
</td>
</tr>
@@ -155,72 +155,75 @@
<group>
<group string="数据源">
<field name="model_id"
placeholder="选择数据模型"
options="{'no_create': True}"/>
placeholder="选择数据模型"
options="{'no_create': True}"/>
<field name="model_name" invisible="1"/>
<field name="description"
placeholder="描述此模板用途,AI 会根据描述判断何时使用"/>
placeholder="描述此模板用途,AI 会根据描述判断何时使用"/>
<field name="active" invisible="1"/>
<field name="column_field_ids" invisible="1"/>
<field name="group_by_ids" widget="many2many_tags"
domain="[('id', 'in', column_field_ids)]"
placeholder="添加分组字段..."/>
domain="[('id', 'in', column_field_ids)]"
placeholder="添加分组字段..."/>
<field name="filter_ids" widget="many2many_tags"
domain="[('id', 'in', column_field_ids)]"
placeholder="添加筛选器..."/>
domain="[('id', 'in', column_field_ids)]"
placeholder="添加筛选器..."/>
</group>
<group string="显示字段">
<!-- <field name="field_ids" widget="many2many_tags"-->
<!-- domain="[('model_id','=',model_id)]"-->
<!-- options="{'no_create': True}"-->
<!-- placeholder="选择要显示的字段(选择后自动生成下方配置)"/>-->
<!-- <field name="field_ids" widget="many2many_tags"-->
<!-- domain="[('model_id','=',model_id)]"-->
<!-- options="{'no_create': True}"-->
<!-- placeholder="选择要显示的字段(选择后自动生成下方配置)"/>-->
<field name="field_list" invisible="1"/>
<field name="field_labels" invisible="1"/>
<field name="default_order"
placeholder="date_order desc"/>
placeholder="date_order desc"/>
<field name="default_visible"/>
<field name="default_domain"
placeholder="[('state','=','sale')]"/>
<field name="fixed_report_url_stored" readonly="1"
placeholder="点击『生成固定链接』按钮生成"
help="固定报表访问链接,凌晨自动刷新数据"/>
placeholder="[('state','=','sale')]"/>
</group>
</group>
<field name="fixed_report_url_stored" readonly="1"
placeholder="点击『生成链接』按钮生成"
help="固定报表访问链接,凌晨自动刷新数据"/>
<notebook>
<page string="汇总卡片" name="cards">
<field name="card_ids" nolabel="1">
<tree string="汇总卡片" editable="bottom">
<field name="model_id" column_invisible="1"/>
<field name="label" placeholder="卡片标签"/>
<field name="field_id"
placeholder="选择数值字段..."
options="{'no_create': True}"/>
<field name="calc"/>
<field name="prefix" placeholder="¥"/>
<field name="unit" placeholder="万"/>
<field name="sequence" widget="handle"/>
</tree>
</field>
</page>
<page string="列定义" name="columns">
<field name="column_ids" nolabel="1">
<tree string="列定义" editable="bottom">
<field name="model_id" column_invisible="1"/>
<field name="field_id"
placeholder="选择字段..."
options="{'no_create': True}"/>
<field name="label" placeholder="显示名称(可选)"/>
<field name="color_operator"/>
<field name="color_value" placeholder="匹配值"/>
<field name="cell_color" widget="color"/>
placeholder="选择字段..."
options="{'no_create': True}"/>
<field name="label" placeholder="显示名称(可选)"/>
<field name="color_operator"/>
<field name="color_value" placeholder="匹配值"/>
<field name="cell_color" widget="color"/>
<field name="width"/>
<field name="sequence" widget="handle"/>
</tree>
</field>
</page>
<page string="汇总卡片" name="cards">
<field name="card_ids" nolabel="1">
<tree string="汇总卡片" editable="bottom">
<field name="model_id" column_invisible="1"/>
<field name="label" placeholder="卡片标签"/>
<field name="field_id"
placeholder="选择数值字段..."
options="{'no_create': True}"/>
<field name="calc"/>
<field name="prefix" placeholder="¥"/>
<field name="unit" placeholder="万"/>
<field name="sequence" widget="handle"/>
</tree>
</field>
</page>
<page string="AI 参数" name="params" invisible="1">
<field name="param_def_ids" nolabel="1">
<tree string="参数定义" editable="bottom">
@@ -229,8 +232,8 @@
<field name="label" placeholder="显示名"/>
<field name="param_type"/>
<field name="field_id"
placeholder="选择映射字段..."
options="{'no_create': True}"/>
placeholder="选择映射字段..."
options="{'no_create': True}"/>
<field name="domain_field" invisible="1"/>
<field name="op" placeholder=">=/="/>
<field name="description" placeholder="AI 提取说明"/>
@@ -254,7 +257,7 @@
<!-- 菜单 → 系统配置 -->
<menuitem id="menu_ai_report_template" name="报表模板"
parent="menu_system_config" action="action_ai_report_template" sequence="5"
groups="yuthon_ai_agent.group_ai_agent_admin"/>
parent="menu_system_config" action="action_ai_report_template" sequence="5"
groups="yuthon_ai_agent.group_ai_agent_admin"/>
</odoo>