diff --git a/addons/activeblue_ai/models/ab_ai_bot.py b/addons/activeblue_ai/models/ab_ai_bot.py index 20c373c..f436d83 100644 --- a/addons/activeblue_ai/models/ab_ai_bot.py +++ b/addons/activeblue_ai/models/ab_ai_bot.py @@ -113,9 +113,9 @@ class AbAiBot(models.Model): [('login', 'in', ('activeblue_ai_bot', 'activeblue_ai_bot@local'))], limit=1) if not bot_user: return - Presence = self.env.get('bus.presence') - if Presence is None: + if 'bus.presence' not in self.env: return + Presence = self.env['bus.presence'] status = 'online' if online else 'offline' now = fields.Datetime.now() rec = Presence.sudo().search([('user_id', '=', bot_user.id)], limit=1)