summaryrefslogtreecommitdiff
path: root/addons/mail/wizard/invite.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-04-27 17:44:28 +0200
committerThibault Delavallée <tde@odoo.com>2018-08-07 15:43:06 +0200
commit689a496f1c60eb662dec7bbf7079f33b070a2cee (patch)
tree06d7887d9ccd1bcaab673aa8cd296c39fd92c794 /addons/mail/wizard/invite.py
parent89051058f4ab7069024f7f6cf2caac05bd68b499 (diff)
[REF] mail: propagate recipient data through notification process
Purpose of this commit is to avoid browsing and prefetching data about recipients when notifying a message to partners and channels. Mail message _notify computes all necessary data in a single query. This commit allow to re-use this data by propagating it through the call chain. Addons inheriting from classification methods used when sending notification emails are updated accordingly to the API and data update. This commit is linked to task ID 47934 and PR #24033. No functional change should occur with this commit.
Diffstat (limited to 'addons/mail/wizard/invite.py')
-rw-r--r--addons/mail/wizard/invite.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/mail/wizard/invite.py b/addons/mail/wizard/invite.py
index 541d3c1ea4f..39d6c0bdeeb 100644
--- a/addons/mail/wizard/invite.py
+++ b/addons/mail/wizard/invite.py
@@ -60,6 +60,11 @@ class Invite(models.TransientModel):
'no_auto_thread': True,
'add_sign': True,
})
- new_partners.with_context(auto_delete=True)._notify(message, document, force_send=True, send_after_commit=False)
+ self.env['res.partner'].with_context(auto_delete=True)._notify(
+ message,
+ [{'id': pid, 'share': True, 'notif': 'email', 'type': 'customer', 'groups': []} for pid in new_partners.ids],
+ document,
+ force_send=True,
+ send_after_commit=False)
message.unlink()
return {'type': 'ir.actions.act_window_close'}