diff options
| author | Thibault Delavallée <tde@odoo.com> | 2016-09-16 09:34:43 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2016-09-23 10:01:41 +0200 |
| commit | 458aaca328491a993f7458520b047869a770325e (patch) | |
| tree | e5a59f62525ae0e8b703642de82f28ef4f56d074 /addons/note/models | |
| parent | fcb51faa9f5a65bac313963673549cf5c10767c9 (diff) | |
[IMP] mail: reimplement grouping of notification recipients
There is now a single method easier to inherit to add specific behavior
for the display of access button as well as actions buttons. All addons
using this mechanism are updated accordingly.
Diffstat (limited to 'addons/note/models')
| -rw-r--r-- | addons/note/models/note.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/addons/note/models/note.py b/addons/note/models/note.py index 439722d13ee..432705347c7 100644 --- a/addons/note/models/note.py +++ b/addons/note/models/note.py @@ -121,14 +121,13 @@ class Note(models.Model): return super(Note, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy) @api.multi - def _notification_get_recipient_groups(self, message, recipients): - res = super(Note, self)._notification_get_recipient_groups(message, recipients) + def _notification_recipients(self, message, groups): + """ All users can create a new note. """ + groups = super(Note, self)._notification_recipients(message, groups) new_action_id = self.env['ir.model.data'].xmlid_to_res_id('note.action_note_note') new_action = self._notification_link_helper('new', action_id=new_action_id) - res['user'] = { - 'actions': [{'url': new_action, 'title': _('New Note')}] - } - return res + groups['user']['actions'] = [{'url': new_action, 'title': _('New Note')}] + return groups @api.multi def action_close(self): |
