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,22 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
from odoo.addons.mail.tools.discuss import Store
class Im_LivechatChannelRule(models.Model):
_inherit = 'im_livechat.channel.rule'
chatbot_script_id = fields.Many2one('chatbot.script', string='Scripted Bot')
ai_agent_id = fields.Many2one(
'ai.agent',
string='AI Agent',
domain="[('is_system_agent', '=', False)]",
index="btree_not_null"
)
def _is_bot_configured(self):
return super()._is_bot_configured() or bool(self.ai_agent_id)
def _store_channel_rule_fields(self, res: Store.FieldList):
super()._store_channel_rule_fields(res)
res.one("ai_agent_id", "_store_agent_fields")