This commit is contained in:
2026-11-08 20:08:53 +08:00
parent 7526a5fe4d
commit 9b924747c5
2692 changed files with 394867 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import messaging_menu

View File

@@ -0,0 +1,25 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.fields import Domain
from odoo.addons.ai.controllers.messaging_menu import AIMessagingMenuController
class AIAgenticMessagingMenuController(AIMessagingMenuController):
def _get_menu_tab_domain(self, tab_id):
# automation runs get their own tab, and leave the AI chat tab
if tab_id.startswith("ai-chat"):
return super()._get_menu_tab_domain(tab_id) & Domain("from_ai_automation", "=", False)
if tab_id.startswith("ai-automation:"):
agent_id = int(tab_id.split(":")[1])
return (
Domain("channel_type", "=", "ai_chat")
& Domain("from_ai_automation", "=", True)
& self._get_ai_agent_channels_domain(agent_id)
)
return super()._get_menu_tab_domain(tab_id)
def _get_menu_tab_filter_domain(self, tab_id, filter_id):
if tab_id.startswith("ai-automation:") and filter_id == "ai_automation_unread":
return Domain("self_member_id.is_unread", "=", True)
return super()._get_menu_tab_filter_domain(tab_id, filter_id)