diff options
| author | Thibault Delavallée <tde@odoo.com> | 2019-10-24 09:05:16 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2019-11-29 13:35:14 +0000 |
| commit | 69ccabb212d83bfee60c7dade36ca4b06f9f2f12 (patch) | |
| tree | 18049ec2a94b7da7d0890bae10c8d35c2d01d427 /addons/mass_mailing/tests | |
| parent | 1838191eece59051805862ed6ce914bf5e5d1efb (diff) | |
[FIX] mail: restrict access to mail.mail model
From now on mail.mail is considered as a technical model. Indeed people should
not really manually craft mails by hand. Instead various functional flows
should either send mails, either craft mails based on some user input.
We therefore make mail restricted to admin users. Flows creating mail.mail
are updated to use sudo, and ensure it was done in a context that makes
sense to delegate this power to the user.
Task ID 1853147
PR #32243
Diffstat (limited to 'addons/mass_mailing/tests')
| -rw-r--r-- | addons/mass_mailing/tests/test_mass_mailing_shortener.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mass_mailing/tests/test_mass_mailing_shortener.py b/addons/mass_mailing/tests/test_mass_mailing_shortener.py index 8bd247691ea..681bbbf0062 100644 --- a/addons/mass_mailing/tests/test_mass_mailing_shortener.py +++ b/addons/mass_mailing/tests/test_mass_mailing_shortener.py @@ -68,7 +68,7 @@ Email: <a id="url4" href="mailto:test@odoo.com">test@odoo.com</h1> mass_mailing.action_put_in_queue() mass_mailing._process_mass_mailing_queue() - sent_mails = self.env['mail.mail'].search([('mailing_id', '=', mass_mailing.id)]) + sent_mails = self.env['mail.mail'].sudo().search([('mailing_id', '=', mass_mailing.id)]) sent_messages = sent_mails.mapped('mail_message_id') self.assertEqual(len(mailing_list_A.contact_ids), len(sent_messages), |
