diff options
| author | Raphael Collet <rco@openerp.com> | 2016-11-25 10:01:14 +0100 |
|---|---|---|
| committer | Raphael Collet <rco@openerp.com> | 2017-01-03 16:52:49 +0100 |
| commit | 5d746d0ac663232d656bb57e82fec290bb5d82fd (patch) | |
| tree | f1d51602745c28b43ab84a309fcbc7080c60e5c9 /addons/mail/tests/test_mail_template.py | |
| parent | 1abd543f1412cf16953fd28659baabf1e4df6010 (diff) | |
[IMP] base, *: tighten `ir.model` access rights
Remove unrestricted "read" access. To make code internally using `ir.model`
work, add a private method `_get` on `ir.model` to retrieve the record
corresponding to a model name, without access rights issue.
Change signature of method `get_authorized_fields` to make it use a model name
instead of a model id. This removes the necessity of a search on `ir.model`.
Diffstat (limited to 'addons/mail/tests/test_mail_template.py')
| -rw-r--r-- | addons/mail/tests/test_mail_template.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/tests/test_mail_template.py b/addons/mail/tests/test_mail_template.py index da335d741a4..26a0336b0fe 100644 --- a/addons/mail/tests/test_mail_template.py +++ b/addons/mail/tests/test_mail_template.py @@ -32,7 +32,7 @@ class TestMailTemplate(TestMail): self.email_2 = 'test2@example.com' self.email_3 = self.partner_1.email self.email_template = self.env['mail.template'].create({ - 'model_id': self.env['ir.model'].search([('model', '=', 'mail.channel')], limit=1).id, + 'model_id': self.env['ir.model']._get('mail.channel').id, 'name': 'Pigs Template', 'subject': '${object.name}', 'body_html': '${object.description}', |
