push
This commit is contained in:
18
dn_ai/__init__.py
Normal file
18
dn_ai/__init__.py
Normal 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')
|
||||
Reference in New Issue
Block a user