summaryrefslogtreecommitdiff
path: root/addons/mail_bot/models/mail_bot.py
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2018-09-24 23:58:55 +0200
committerAntony Lesuisse <al@openerp.com>2018-10-01 16:37:59 +0200
commit837c738d8ba896e8ae4e5ebe63338fd301d1fd9b (patch)
treea8e9714c410de7be7f138d0390a92292df1ea160 /addons/mail_bot/models/mail_bot.py
parentb30df8f3fdd31b273f1203a51ad49ab5c8d0c20b (diff)
[FIX] mail_bot: Merge OdooBot and System
As we want that operations done by the system such as reordering rules be done by him.
Diffstat (limited to 'addons/mail_bot/models/mail_bot.py')
-rw-r--r--addons/mail_bot/models/mail_bot.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/mail_bot/models/mail_bot.py b/addons/mail_bot/models/mail_bot.py
index ec012fb2f6c..96a7a1988dc 100644
--- a/addons/mail_bot/models/mail_bot.py
+++ b/addons/mail_bot/models/mail_bot.py
@@ -21,7 +21,7 @@ class MailBot(models.AbstractModel):
:param values: msg_values of the message_post or other values needed by logic
:param command: the name of the called command if the logic is not triggered by a message_post
"""
- odoobot_id = self.env['ir.model.data'].xmlid_to_res_id("mail_bot.partner_odoobot")
+ odoobot_id = self.env['ir.model.data'].xmlid_to_res_id("base.partner_root")
if len(record) != 1 or values.get("author_id") == odoobot_id:
return
if self._is_bot_pinged(values) or self._is_bot_in_private_channel(record):
@@ -213,11 +213,11 @@ class MailBot(models.AbstractModel):
return False
def _is_bot_pinged(self, values):
- odoobot_id = self.env['ir.model.data'].xmlid_to_res_id("mail_bot.partner_odoobot")
+ odoobot_id = self.env['ir.model.data'].xmlid_to_res_id("base.partner_root")
return (4, odoobot_id) in values.get('partner_ids', [])
def _is_bot_in_private_channel(self, record):
- odoobot_id = self.env['ir.model.data'].xmlid_to_res_id("mail_bot.partner_odoobot")
+ odoobot_id = self.env['ir.model.data'].xmlid_to_res_id("base.partner_root")
if record._name == 'mail.channel' and record.channel_type == 'chat':
return odoobot_id in record.with_context(active_test=False).channel_partner_ids.ids
return False