summaryrefslogtreecommitdiff
path: root/addons/mail/controllers
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2019-10-23 12:56:36 +0000
committerThibault Delavallée <tde@odoo.com>2019-11-29 13:35:14 +0000
commitb9a22d2f24e587894c12bf7ad289fcddcea8a823 (patch)
tree4b958db8a774c45b51a5a7a80b817d50695643cb /addons/mail/controllers
parent351b0ca6f4f493fed3542c8f52e8ec70ee622b7e (diff)
[IMP] mail: add computed fields for company emails
Purpose of this commit is to give a way to access to company email and catchall with formatting. Those will be used in various automated emails. Indeed currently several templates use either ``company_id.partner_id.email``, ``company_id.email``, or even don't provide fallback values. With this commit from a company record people will be able to use * a correctly formatted catchall: ``"My Company Name" <catchall_alias@catchall_domain>`` * an email_formatted field like partner email_formatted that is either its partner-related email_formatted value, or formatted catchall if its partner is not correctly configured; Various calls to mail creation are updated accordingly. Task ID 1853147 PR #32243
Diffstat (limited to 'addons/mail/controllers')
-rw-r--r--addons/mail/controllers/bus.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/controllers/bus.py b/addons/mail/controllers/bus.py
index cecf83eb1b7..81f1700987d 100644
--- a/addons/mail/controllers/bus.py
+++ b/addons/mail/controllers/bus.py
@@ -47,7 +47,7 @@ class MailChatController(BusController):
email_from = author.email_formatted
else: # If Public User, use catchall email from company
author_id = False
- email_from = mail_channel.anonymous_name or mail_channel.create_uid.company_id.catchall
+ email_from = mail_channel.anonymous_name or mail_channel.create_uid.company_id.catchall_formatted
# post a message without adding followers to the channel. email_from=False avoid to get author from email data
body = tools.plaintext2html(message_content)
message = mail_channel.with_context(mail_create_nosubscribe=True).message_post(author_id=author_id,