diff options
| author | Deep Patel <dep@odoo.com> | 2018-06-21 15:26:50 +0530 |
|---|---|---|
| committer | Romain Derie <rde@odoo.com> | 2018-07-20 10:16:59 +0200 |
| commit | 5ef8300cdd9f00dfd5d6eb186dffafb9be5c0e30 (patch) | |
| tree | f88805742db46292b9f3244b029a92857e2ce618 /addons/website | |
| parent | 624d75ca94c47c27ccba3ce6666402b050c30e92 (diff) | |
[ADD] web_unsplash: Find free high-resolution images from Unsplash
This commit:
1. Adds settings to install the new `web_unsplash` enterprise module.
See counterpart commit on enterprise for details.
2. Export `ImageWidget` and `update_control_panel` to be able to override them.
3. Add the unsplash access key rights to website designer. (see related OE
commit)
task-35060
Closes #25825, closes #25637
Diffstat (limited to 'addons/website')
| -rw-r--r-- | addons/website/models/res_users.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/website/models/res_users.py b/addons/website/models/res_users.py index bab898d24c8..d8eb61d9e7c 100644 --- a/addons/website/models/res_users.py +++ b/addons/website/models/res_users.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import fields, models +from odoo import api, fields, models class ResUsers(models.Model): @@ -11,3 +11,10 @@ class ResUsers(models.Model): selection=lambda self: self._get_group_selection('base.module_category_website'), string='Website Editor', compute='_compute_groups_id', inverse='_inverse_groups_id', category_xml_id='base.module_category_website') + + @api.multi + def _has_unsplash_key_rights(self): + self.ensure_one() + if self.has_group('website.group_website_designer'): + return True + return super(ResUsers, self)._has_unsplash_key_rights() |
