diff options
| author | Thibault Delavallée <tde@odoo.com> | 2018-04-27 17:44:28 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2018-08-07 15:43:06 +0200 |
| commit | 689a496f1c60eb662dec7bbf7079f33b070a2cee (patch) | |
| tree | 06d7887d9ccd1bcaab673aa8cd296c39fd92c794 /addons/project/models/project.py | |
| parent | 89051058f4ab7069024f7f6cf2caac05bd68b499 (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/project/models/project.py')
| -rw-r--r-- | addons/project/models/project.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 373e6e0eee7..c5c5370d78a 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -829,8 +829,9 @@ class Task(models.Model): if not self.user_id and not self.stage_id.fold: take_action = self._notify_get_action_link('assign') project_actions = [{'url': take_action, 'title': _('I take it')}] + project_user_group_id = self.env.ref('project.group_project_user').id new_group = ( - 'group_project_user', lambda partner: bool(partner.user_ids) and any(user.has_group('project.group_project_user') for user in partner.user_ids), { + 'group_project_user', lambda pdata: pdata['type'] == 'user' and project_user_group_id in pdata['groups'], { 'actions': project_actions, }) groups = [new_group] + groups |
