diff options
| author | Anh Thao Pham (pta) <pta@odoo.com> | 2021-02-11 09:40:00 +0000 |
|---|---|---|
| committer | Anh Thao Pham (pta) <pta@odoo.com> | 2021-03-29 14:31:23 +0000 |
| commit | 20536e1bbeb641539c0de44364f8376e7cef651b (patch) | |
| tree | 59f731c45a7bfcad2fd712317515f43c22c556c0 /addons/mail/wizard/invite.py | |
| parent | 43bf5a5f048115a94eecc7a23a7e3fea119ac76c (diff) | |
[FIX] mail: prevent use of private addresses for followers, recipients,...
- Connect with Admin
- Go to Contacts, edit himself by adding a Private Address
- Create an Internal User without "Access to Private Addresses" right (i.e. User X)
- Go to any app implementing chatter (i.e. Sales)
- Create a SO
- Add the created Private Address as follower
- Make sure User X can access the record (i.e. Sales: Administrator)
- Connect with User X and open the SO
An Access Error is raised while trying to fetch data about the followers.
This commit prevents to:
- add a private address as follower of a record
- add a private address as Recipient in full composer
- propose private addresses when adding a mention to a partner
opw-2428936
closes odoo/odoo#65933
Task-id: 2463622
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/mail/wizard/invite.py')
| -rw-r--r-- | addons/mail/wizard/invite.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/mail/wizard/invite.py b/addons/mail/wizard/invite.py index 610b1a0dd3e..8b6a2de8342 100644 --- a/addons/mail/wizard/invite.py +++ b/addons/mail/wizard/invite.py @@ -41,7 +41,8 @@ class Invite(models.TransientModel): res_model = fields.Char('Related Document Model', required=True, index=True, help='Model of the followed resource') res_id = fields.Integer('Related Document ID', index=True, help='Id of the followed resource') - partner_ids = fields.Many2many('res.partner', string='Recipients', help="List of partners that will be added as follower of the current document.") + partner_ids = fields.Many2many('res.partner', string='Recipients', help="List of partners that will be added as follower of the current document.", + domain=[('type', '!=', 'private')]) channel_ids = fields.Many2many('mail.channel', string='Channels', help='List of channels that will be added as listeners of the current document.', domain=[('channel_type', '=', 'channel')]) message = fields.Html('Message') |
