From 38fa508e0ffca45d781827d0ca1a1c43b3f6cb8f Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Sat, 25 Apr 2026 17:10:35 -0400 Subject: [PATCH] fix(addon): correct existence check for bus.presence model env.get() isn't an Odoo Environment method, so the existence guard silently returned without ever writing the bot's presence row. Use the 'in self.env' check instead. --- addons/activeblue_ai/models/ab_ai_bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)