summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_message.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-01-19 11:17:11 +0100
committerThibault Delavallée <tde@odoo.com>2018-01-29 16:33:07 +0100
commitcae1c3977ff2777dcb77e4c2a51deb72ee57db22 (patch)
treed1e22c2cbff9d2fe88c89e9acfa1947aa35b7fbf /addons/mail/models/mail_message.py
parent304e6cf90b9ef969c809030b3e65ac6b667eea0e (diff)
[REF] mail: rename notification methods and make them private
Purpose of this commit is to perform a light cleaning of the email notification process. It renames method by prefixing them by _notify in order to easily spot them. It also makes them private because they should not be called outside of other methods. Indeed those methods are technical and do not provide useful information to external people. Future commits will probably improve the notification process in order to clean it and try to reduce its query count. This commit perform the following renaming * message_get_email_values -> _notify_specific_email_values * message_get_recipient_values -> _notify_email_recipients * _message_notification_recipients -> _notify_classify_recipients * message_get_reply_to -> _notify_get_reply_to
Diffstat (limited to 'addons/mail/models/mail_message.py')
-rw-r--r--addons/mail/models/mail_message.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py
index 1973c204b13..0f3665c4acb 100644
--- a/addons/mail/models/mail_message.py
+++ b/addons/mail/models/mail_message.py
@@ -699,14 +699,14 @@ class Message(models.Model):
@api.model
def _get_reply_to(self, values):
""" Return a specific reply_to: alias of the document through
- message_get_reply_to or take the email_from """
+ _notify_get_reply_to or take the email_from """
model, res_id, email_from = values.get('model', self._context.get('default_model')), values.get('res_id', self._context.get('default_res_id')), values.get('email_from') # ctx values / defualt_get res ?
- if model and hasattr(self.env[model], 'message_get_reply_to'):
- # return self.env[model].browse(res_id).message_get_reply_to([res_id], default=email_from)[res_id]
- return self.env[model].message_get_reply_to([res_id], default=email_from)[res_id]
+ if model and hasattr(self.env[model], '_notify_get_reply_to'):
+ # return self.env[model].browse(res_id)._notify_get_reply_to([res_id], default=email_from)[res_id]
+ return self.env[model]._notify_get_reply_to([res_id], default=email_from)[res_id]
else:
- # return self.env['mail.thread'].message_get_reply_to(default=email_from)[None]
- return self.env['mail.thread'].message_get_reply_to([None], default=email_from)[None]
+ # return self.env['mail.thread']._notify_get_reply_to(default=email_from)[None]
+ return self.env['mail.thread']._notify_get_reply_to([None], default=email_from)[None]
@api.model
def _get_message_id(self, values):