From c48b1333f833b92fcd01f8471c2767bbbba996a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Fri, 29 May 2026 18:02:22 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_ai_agent/models/ai_agent.py | 2 +- yuthon_wechat/models/wecom_apps.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/yuthon_ai_agent/models/ai_agent.py b/yuthon_ai_agent/models/ai_agent.py index 83fa6f27e..629163331 100644 --- a/yuthon_ai_agent/models/ai_agent.py +++ b/yuthon_ai_agent/models/ai_agent.py @@ -492,7 +492,7 @@ class AiConversation(models.Model): if employee and employee.wecom_userid: self.sudo().env["wecom.apps"].sync_send_message_textcard( category='agent', - touser=employee.wecom_userid, + user_id=employee.wecom_userid, title=f"📊 {report_name}", description=f"数据来源:{model_name}\n生成时间:{fields.Datetime.now().strftime('%Y-%m-%d %H:%M')}\n点击下方按钮查看详细报表", url=url, diff --git a/yuthon_wechat/models/wecom_apps.py b/yuthon_wechat/models/wecom_apps.py index 4b3d42c69..a4f5e1f92 100644 --- a/yuthon_wechat/models/wecom_apps.py +++ b/yuthon_wechat/models/wecom_apps.py @@ -204,8 +204,10 @@ class WeComApps(models.Model): }, } else: + # 默认分支:优先用 user_id,其次用 touser + target_user = user_id or touser data = { - 'touser': touser, + 'touser': target_user, 'msgtype': 'textcard', 'agentid': wecom_app.agent_id, "textcard": {