summaryrefslogtreecommitdiff
path: root/addons/note/models
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-05-11 09:29:56 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-05-12 08:26:10 +0000
commit4e5941624b94a8abcb14afcac7c8fa78da43173d (patch)
tree470fcc1fdc77f5796255970182813cec3d305c0f /addons/note/models
parent3a11b9e757d0b649f434f78eec2cd35b52e27a28 (diff)
[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>
Diffstat (limited to 'addons/note/models')
-rw-r--r--addons/note/models/note.py8
1 files changed, 8 insertions, 0 deletions
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):