From 6de17cff813d167b9454635d6ebecf9ef0e0dcad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kh=C3=B4i=20=28Ki=C3=AAn=20Kim=29?= Date: Wed, 25 Sep 2024 15:47:09 +0700 Subject: [PATCH] [MIG] base_technical_features: Migration to 18.0 --- base_technical_features/README.rst | 21 +++++++++---- base_technical_features/__manifest__.py | 2 +- base_technical_features/models/base.py | 30 ++++++++++++------- .../readme/CONTRIBUTORS.md | 1 + base_technical_features/readme/CREDITS.md | 3 ++ .../static/description/index.html | 29 ++++++++++++------ base_technical_features/views/res_users.xml | 2 +- 7 files changed, 60 insertions(+), 28 deletions(-) create mode 100644 base_technical_features/readme/CREDITS.md diff --git a/base_technical_features/README.rst b/base_technical_features/README.rst index 1e84128882..cb84eaa119 100644 --- a/base_technical_features/README.rst +++ b/base_technical_features/README.rst @@ -17,13 +17,13 @@ Technical features group :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github - :target: https://github.com/OCA/server-ux/tree/17.0/base_technical_features + :target: https://github.com/OCA/server-ux/tree/18.0/base_technical_features :alt: OCA/server-ux .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-ux-17-0/server-ux-17-0-base_technical_features + :target: https://translation.odoo-community.org/projects/server-ux-18-0/server-ux-18-0-base_technical_features :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/server-ux&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/server-ux&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -62,7 +62,7 @@ In the background, this preference is mapped to the *Technical feature can therefore manage this preference from the regular Users and Groups menu items. -.. |image1| image:: https://raw.githubusercontent.com/OCA/server-ux/17.0/base_technical_features/static/description/user_preferences.png +.. |image1| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/base_technical_features/static/description/user_preferences.png Bug Tracker =========== @@ -70,7 +70,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -88,6 +88,15 @@ Contributors - Stefan Rijnhart - Jeroen Evens - Jim Hoefnagels +- Khoi (Kien Kim) + +Other credits +------------- + +The migration of this module from 17.0 to 18.0 was financially supported +by: + +- Camptocamp. Maintainers ----------- @@ -102,6 +111,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/server-ux `_ project on GitHub. +This module is part of the `OCA/server-ux `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/base_technical_features/__manifest__.py b/base_technical_features/__manifest__.py index 5ad7823bd9..db3824469d 100644 --- a/base_technical_features/__manifest__.py +++ b/base_technical_features/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Technical features group", "summary": "Access to technical features without activating debug mode", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "category": "Usability", "website": "https://github.com/OCA/server-ux", "author": "Opener B.V., Odoo Community Association (OCA)", diff --git a/base_technical_features/models/base.py b/base_technical_features/models/base.py index 9ecb389344..9e268850c1 100644 --- a/base_technical_features/models/base.py +++ b/base_technical_features/models/base.py @@ -1,18 +1,26 @@ # © 2016 Opener B.V. () # 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 diff --git a/base_technical_features/readme/CONTRIBUTORS.md b/base_technical_features/readme/CONTRIBUTORS.md index 82685451a9..cf2835a49e 100644 --- a/base_technical_features/readme/CONTRIBUTORS.md +++ b/base_technical_features/readme/CONTRIBUTORS.md @@ -1,3 +1,4 @@ - Stefan Rijnhart \<\> - Jeroen Evens \<\> - Jim Hoefnagels \<\> +- Khoi (Kien Kim) \<\> diff --git a/base_technical_features/readme/CREDITS.md b/base_technical_features/readme/CREDITS.md new file mode 100644 index 0000000000..80354b7d28 --- /dev/null +++ b/base_technical_features/readme/CREDITS.md @@ -0,0 +1,3 @@ +The migration of this module from 17.0 to 18.0 was financially supported by: + +- Camptocamp. diff --git a/base_technical_features/static/description/index.html b/base_technical_features/static/description/index.html index 912726ac6b..fc5158072e 100644 --- a/base_technical_features/static/description/index.html +++ b/base_technical_features/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -369,7 +369,7 @@

Technical features group

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:b1f95f15bf88e671bb7843b72fce85702596559dd2c986cdfb15b0219745b85f !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/server-ux Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/server-ux Translate me on Weblate Try me on Runboat

Access to technical features without activating debug mode

In Odoo 9.0 and later, the debug mode grants every employee user access @@ -392,7 +392,7 @@

Configuration

enabling debug mode. Additionally, users can check the Technical feature field in their preferences to gain permanent access to the menus and views that fall under this category.

-

image1

+

image1

Upon installation of this module, this preference is already set for the administrator user of the database.

In the background, this preference is mapped to the Technical feature @@ -404,7 +404,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -423,16 +423,27 @@

Contributors

  • Stefan Rijnhart <stefan@opener.am>
  • Jeroen Evens <jeroen.evens@dynapps.be>
  • Jim Hoefnagels <jim.hoefnagels@dynapps.be>
  • +
  • Khoi (Kien Kim) <khoikk@trobz.com>
  • + +
    +
    +

    Other credits

    +

    The migration of this module from 17.0 to 18.0 was financially supported +by:

    +
      +
    • Camptocamp.

    Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +Odoo Community Association +

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    -

    This module is part of the OCA/server-ux project on GitHub.

    +

    This module is part of the OCA/server-ux project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    diff --git a/base_technical_features/views/res_users.xml b/base_technical_features/views/res_users.xml index 1a8b1b06b3..874be37ac0 100644 --- a/base_technical_features/views/res_users.xml +++ b/base_technical_features/views/res_users.xml @@ -7,7 +7,7 @@ res.users - +