[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) <nim@odoo.com>
This commit is contained in:
Andrea Grazioso (agr-odoo)
2020-05-12 08:26:10 +00:00
parent 3a11b9e757
commit 4e5941624b
+8
View File
@@ -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):