Skip to content

Commit

Permalink
[MIG] base_technical_features: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimkhoi3010 committed Oct 15, 2024
1 parent 0ddd2f3 commit 6de17cf
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 28 deletions.
21 changes: 15 additions & 6 deletions base_technical_features/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -62,15 +62,15 @@ 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
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/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 <https://github.com/OCA/server-ux/issues/new?body=module:%20base_technical_features%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20base_technical_features%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand All @@ -88,6 +88,15 @@ 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
-----------
Expand All @@ -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 <https://github.com/OCA/server-ux/tree/17.0/base_technical_features>`_ project on GitHub.
This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/18.0/base_technical_features>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion base_technical_features/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
30 changes: 19 additions & 11 deletions base_technical_features/models/base.py
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
1 change: 1 addition & 0 deletions base_technical_features/readme/CONTRIBUTORS.md
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>\>
3 changes: 3 additions & 0 deletions base_technical_features/readme/CREDITS.md
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.
29 changes: 20 additions & 9 deletions base_technical_features/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -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.
Expand Down Expand Up @@ -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 }
Expand All @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Technical features group</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b1f95f15bf88e671bb7843b72fce85702596559dd2c986cdfb15b0219745b85f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-ux/tree/17.0/base_technical_features"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-ux-17-0/server-ux-17-0-base_technical_features"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-ux&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-ux/tree/18.0/base_technical_features"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-ux-18-0/server-ux-18-0-base_technical_features"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-ux&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<div class="section" id="access-to-technical-features-without-activating-debug-mode">
<h1>Access to technical features without activating debug mode</h1>
<p>In Odoo 9.0 and later, the debug mode grants every employee user access
Expand All @@ -392,7 +392,7 @@ <h1>Configuration</h1>
enabling debug mode. Additionally, users can check the <em>Technical
feature</em> field in their preferences to gain permanent access to the
menus and views that fall under this category.</p>
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/server-ux/17.0/base_technical_features/static/description/user_preferences.png" /></p>
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/server-ux/18.0/base_technical_features/static/description/user_preferences.png" /></p>
<p>Upon installation of this module, this preference is already set for the
administrator user of the database.</p>
<p>In the background, this preference is mapped to the <em>Technical feature
Expand All @@ -404,7 +404,7 @@ <h2>Bug Tracker</h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-ux/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/server-ux/issues/new?body=module:%20base_technical_features%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/server-ux/issues/new?body=module:%20base_technical_features%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -423,16 +423,27 @@ <h1>Contributors</h1>
<li>Stefan Rijnhart &lt;<a class="reference external" href="mailto:stefan&#64;opener.am">stefan&#64;opener.am</a>&gt;</li>
<li>Jeroen Evens &lt;<a class="reference external" href="mailto:jeroen.evens&#64;dynapps.be">jeroen.evens&#64;dynapps.be</a>&gt;</li>
<li>Jim Hoefnagels &lt;<a class="reference external" href="mailto:jim.hoefnagels&#64;dynapps.be">jim.hoefnagels&#64;dynapps.be</a>&gt;</li>
<li>Khoi (Kien Kim) &lt;<a class="reference external" href="mailto:khoikk&#64;trobz.com">khoikk&#64;trobz.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
<h1>Other credits</h1>
<p>The migration of this module from 17.0 to 18.0 was financially supported
by:</p>
<ul class="simple">
<li>Camptocamp.</li>
</ul>
</div>
<div class="section" id="maintainers">
<h1>Maintainers</h1>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-ux/tree/17.0/base_technical_features">OCA/server-ux</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-ux/tree/18.0/base_technical_features">OCA/server-ux</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion base_technical_features/views/res_users.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
<field name="arch" type="xml">
<field name="tz_offset" position="after">
<field name="tz" position="after">
<field
name="technical_features"
readonly="0"
Expand Down

0 comments on commit 6de17cf

Please sign in to comment.