summaryrefslogtreecommitdiff
path: root/addons/mail/wizard/mail_compose_message.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-08-27 12:52:35 +0000
committerThibault Delavallée <tde@odoo.com>2020-08-27 14:29:54 +0000
commitf5df1ed912455e5ed52a65df3149f30a9d424de0 (patch)
treebf25cb5783f8e7f8a8e0c3d06b3489eb1544b4c5 /addons/mail/wizard/mail_compose_message.py
parent4a5fc70cfc3c86da33e2480fbd59c8f6d575c6e9 (diff)
[REF] mail: move generic methods from thread to BaseModel
PURPOSE Since v13 some commits added code in mail thread file. This file is already quite long and keeping it organized allow to understand its content. SPECIFICATIONS Some methods defined on mail.thread may actually be called on models not inheriting from mail.thread . Instead of having model methods on mail thread receiving a records parameter it seems better to have those available directly on BaseModel. Move static_message_track on BaseModel in models.py. This method is now called _mail_track, to be coherent with othe rmail-related naming. It is used in accounting to track values in line model that does not inherit from mail. thread. Update accounting accordingly (followup of d862965). Move _message_get_default_recipients_on_records in models.py. Renaming it _message_get_default_recipients() allow to be compatible with current behavior and current override available in some addons (like CRM, event, ...). Move _notify_get_reply_to_on_records in models.py. Renaming it _notify_get_reply_to() allows to be shorter and coherent. Move _alias_check_contact_on_record in models.py. Renaming it _alias_check_contact_() allows to be shorter and coherent. Its override in hr is also moved on BaseModel. Backward compatibility is kept for those methods as this PR target a mostly stable version. LINKS Task ID-2327096 (code cleaning) PR #56631
Diffstat (limited to 'addons/mail/wizard/mail_compose_message.py')
-rw-r--r--addons/mail/wizard/mail_compose_message.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py
index f66bdba6557..e9df4a0cb80 100644
--- a/addons/mail/wizard/mail_compose_message.py
+++ b/addons/mail/wizard/mail_compose_message.py
@@ -278,7 +278,7 @@ class MailComposer(models.TransientModel):
reply_to_value = dict.fromkeys(res_ids, None)
if mass_mail_mode and not self.no_auto_thread:
records = self.env[self.model].browse(res_ids)
- reply_to_value = self.env['mail.thread']._notify_get_reply_to_on_records(default=self.email_from, records=records)
+ reply_to_value = records._notify_get_reply_to(default=self.email_from)
blacklisted_rec_ids = []
if mass_mail_mode and issubclass(type(self.env[self.model]), self.pool['mail.thread.blacklist']):
@@ -462,7 +462,7 @@ class MailComposer(models.TransientModel):
default_recipients = {}
if not self.partner_ids:
records = self.env[self.model].browse(res_ids).sudo()
- default_recipients = self.env['mail.thread']._message_get_default_recipients_on_records(records)
+ default_recipients = records._message_get_default_recipients()
results = dict.fromkeys(res_ids, False)
for res_id in res_ids: