diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-08-14 16:48:10 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-08-14 16:48:10 +0200 |
| commit | 140ee6b8f0b0de7ddcc816496269963612c5d0c6 (patch) | |
| tree | 7bdaa065d215b88fea4fa56adbfa79cdc24deb69 /addons/mail/wizard/mail_compose_message.py | |
| parent | 839696d2d7dd574fd8958d17726379926e94d590 (diff) | |
| parent | 98a55917a602c0c47093b4270ebc4e8b416ecf32 (diff) | |
[MERGE] forward port branch saas-12.4 up to 98a55917a60
Diffstat (limited to 'addons/mail/wizard/mail_compose_message.py')
| -rw-r--r-- | addons/mail/wizard/mail_compose_message.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index a056fdafa66..d3a33e8a7f1 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -8,6 +8,7 @@ import re from odoo import _, api, fields, models, SUPERUSER_ID, tools from odoo.tools.safe_eval import safe_eval +from odoo.exceptions import UserError # main mako-like expression pattern @@ -277,7 +278,9 @@ class MailComposer(models.TransientModel): if wizard.model: post_params['model'] = wizard.model post_params['res_id'] = res_id - ActiveModel.message_notify(**post_params) + if not ActiveModel.message_notify(**post_params): + # if message_notify returns an empty record set, no recipients where found. + raise UserError(_("No recipient found.")) else: ActiveModel.browse(res_id).message_post(**post_params) @@ -321,7 +324,6 @@ class MailComposer(models.TransientModel): 'attachment_ids': [attach.id for attach in self.attachment_ids], 'author_id': self.author_id.id, 'email_from': self.email_from, - 'reply_to': self.reply_to, 'record_name': self.record_name, 'no_auto_thread': self.no_auto_thread, 'mail_server_id': self.mail_server_id.id, |
