This commit is contained in:
2026-11-25 11:58:57 +08:00
parent 5fc4382687
commit 88b4fe3d59
3210 changed files with 11146 additions and 601197 deletions

18
dn_ai/__init__.py Normal file
View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
import logging
from . import models
from . import controllers
_logger = logging.getLogger(__name__)
def post_init_hook(env):
"""Give the built-in agent a partner so it can post in Discuss."""
agent = env.ref('dn_ai.ai_default_agent', raise_if_not_found=False)
if agent and not agent.partner_id:
agent.partner_id = env['res.partner'].create({
'name': agent.name or 'AI Assistant',
'is_company': False,
})
_logger.info("dn_ai: post-install ready (agent=%s)", agent.name if agent else 'none')