-
-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] base_technical_features: Migration to 18.0
- Loading branch information
1 parent
0ddd2f3
commit 6de17cf
Showing
7 changed files
with
60 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
# © 2016 Opener B.V. (<https://opener.am>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from odoo import models | ||
|
||
from lxml import etree | ||
|
||
from odoo import api, models | ||
|
||
|
||
class Base(models.AbstractModel): | ||
_inherit = "base" | ||
|
||
def user_has_groups(self, groups): | ||
"""Return True for users in the technical features group when | ||
membership of the original group is checked, even if debug mode | ||
is not enabled. | ||
""" | ||
if "base.group_no_one" in groups.split(",") and self.env.user.has_group( | ||
"base_technical_features.group_technical_features" | ||
): | ||
return True | ||
return super().user_has_groups(groups) | ||
@api.model | ||
def _get_view(self, view_id=None, view_type="form", **options): | ||
arch, view = super()._get_view(view_id=view_id, view_type=view_type, **options) | ||
arch_str = etree.tostring(arch, encoding="unicode") | ||
# Replace "base.group_no_one" with | ||
# "base.group_no_one, base_technical_features.group_technical_features" | ||
# This adds additional access to elements that were restricted to | ||
# "base.group_no_one" | ||
arch_str = arch_str.replace( | ||
"base.group_no_one", | ||
"base.group_no_one,base_technical_features.group_technical_features", | ||
) | ||
arch = etree.fromstring(arch_str) | ||
|
||
return arch, view |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
- Stefan Rijnhart \<<stefan@opener.am>\> | ||
- Jeroen Evens \<<jeroen.evens@dynapps.be>\> | ||
- Jim Hoefnagels \<<jim.hoefnagels@dynapps.be>\> | ||
- Khoi (Kien Kim) \<<khoikk@trobz.com>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The migration of this module from 17.0 to 18.0 was financially supported by: | ||
|
||
- Camptocamp. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters