From 4e5941624b94a8abcb14afcac7c8fa78da43173d Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Mon, 11 May 2020 09:29:56 +0000 Subject: [PATCH] [FIX] note: fix follower assignation permissions - Have a standard V13 with note - Connect as Admin A - Create User U1 and U2 with password and email on partner - As A, create a note N - Add U1 as a follower - Login as U1 - Open N and add U2 as a follower We have a custom record rule that provide access to notes if you are in the "message_partner_ids" of the Notes. An override to the field in notes to compute as sudo fix the issue opw-2223632 closes odoo/odoo#51082 X-original-commit: e1fbac466ff6c3abfd0de5760f43a3ff2e5cdb90 Signed-off-by: Nicolas Martinelli (nim) --- addons/note/models/note.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/note/models/note.py b/addons/note/models/note.py index 6fbe39477df..5578104c468 100644 --- a/addons/note/models/note.py +++ b/addons/note/models/note.py @@ -52,6 +52,14 @@ class Note(models.Model): date_done = fields.Date('Date done') color = fields.Integer(string='Color Index') tag_ids = fields.Many2many('note.tag', 'note_tags_rel', 'note_id', 'tag_id', string='Tags') + message_partner_ids = fields.Many2many( + comodel_name='res.partner', string='Followers (Partners)', + compute='_get_followers', search='_search_follower_partners', + compute_sudo=True) + message_channel_ids = fields.Many2many( + comodel_name='mail.channel', string='Followers (Channels)', + compute='_get_followers', search='_search_follower_channels', + compute_sudo=True) @api.depends('memo') def _compute_name(self):