diff options
| author | Xavier-Do <xdo@odoo.com> | 2019-04-12 11:42:47 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2019-05-29 13:32:26 +0000 |
| commit | c9d173a3e7645eef388a927466d564889d304cb6 (patch) | |
| tree | b9bf26d7f6d46ff0ffdd05c2d9b06ab28066a8b6 /addons/mail/wizard/mail_compose_message.py | |
| parent | 2bfc0bc8931d33bf588c4899e50ac2ce77f0199a (diff) | |
[REF] mail, various: apply light code cleaning
Purpose of this commit is to clean some bits of code, notably calls to
message_post/log as well as notification methods. It will ease performance
improvement work.
Small optimization: account: read content after extension check
Parameter cleaning
* use message log with kwargs instead of args;
* remove message post after hook useless parameters;
* remove _notify_email_recipients useless message parameter;
* remove message_notify useless send_after_commit parameters;
* remove message post params matching default values;
Other improvements
* remove message_post commands support for partners and channels;
* only calls message_post with ids list for channels and partners. We
don't support mix of ids and command anymore to simplify code;
* remove support of private discussion in mail.thread adding partners
as recipients, as there is no use anymore;
Related to task 1943901
Linked to PR #32404
Diffstat (limited to 'addons/mail/wizard/mail_compose_message.py')
| -rw-r--r-- | addons/mail/wizard/mail_compose_message.py | 4 |
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 72076826085..fe09f0ff18c 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -184,9 +184,9 @@ class MailComposer(models.TransientModel): result['model'] = parent.model if not values.get('res_id'): result['res_id'] = parent.res_id - partner_ids = values.get('partner_ids', list()) + [(4, id) for id in parent.partner_ids.ids] + partner_ids = values.get('partner_ids', list()) + parent.partner_ids.ids if self._context.get('is_private') and parent.author_id: # check message is private then add author also in partner list. - partner_ids += [(4, parent.author_id.id)] + partner_ids += [parent.author_id.id] result['partner_ids'] = partner_ids elif values.get('model') and values.get('res_id'): doc_name_get = self.env[values.get('model')].browse(values.get('res_id')).name_get() |
