diff --git a/addons/web_unsplash/models/res_users.py b/addons/web_unsplash/models/res_users.py index 375a0ce37ad..4a8dd6ad517 100644 --- a/addons/web_unsplash/models/res_users.py +++ b/addons/web_unsplash/models/res_users.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import api, models +from odoo import models class ResUsers(models.Model): @@ -8,4 +8,8 @@ class ResUsers(models.Model): def _has_unsplash_key_rights(self): self.ensure_one() - return self.has_group('base.group_erp_manager') + # Website has no dependency to web_unsplash, we cannot warranty the order of the execution + # of the overwrite done in 5ef8300. + # So to avoid to create a new module bridge, with a lot of code, we prefer to make a check + # here for website's user. + return self.has_group('base.group_erp_manager') or self.has_group('website.group_website_designer') diff --git a/addons/website/models/res_users.py b/addons/website/models/res_users.py index 71a507e878c..1d582a128de 100644 --- a/addons/website/models/res_users.py +++ b/addons/website/models/res_users.py @@ -19,12 +19,6 @@ class ResUsers(models.Model): ('login_key', 'unique (login, website_id)', 'You can not have two users with the same login!'), ] - 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() - @api.constrains('login', 'website_id') def _check_login(self): """ Do not allow two users with the same login without website """