Skip to content

Commit

Permalink
[MIG] base_technical_features: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
apineux committed Oct 4, 2022
1 parent 0509025 commit 66e4d8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
14 changes: 7 additions & 7 deletions base_technical_features/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ 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/15.0/base_technical_features
:target: https://github.com/OCA/server-ux/tree/16.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-15-0/server-ux-15-0-base_technical_features
:target: https://translation.odoo-community.org/projects/server-ux-16-0/server-ux-16-0-base_technical_features
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/250/15.0
:target: https://runbot.odoo-community.org/runbot/250/16.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
|badge1| |badge2| |badge3| |badge4| |badge5|

==========================================================
Access to technical features without activating debug mode
Expand All @@ -50,7 +50,7 @@ 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.

.. figure:: https://raw.githubusercontent.com/OCA/server-ux/15.0/base_technical_features/static/description/user_preferences.png
.. figure:: https://raw.githubusercontent.com/OCA/server-ux/16.0/base_technical_features/static/description/user_preferences.png
:alt: User preferences

Upon installation of this module, this preference is already
Expand All @@ -66,7 +66,7 @@ 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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20base_technical_features%0Aversion:%2015.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:%2016.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 Down Expand Up @@ -98,6 +98,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/15.0/base_technical_features>`_ project on GitHub.
This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/16.0/base_technical_features>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
14 changes: 5 additions & 9 deletions base_technical_features/tests/test_base_technical_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,18 @@ def test02_visible_fields(self):
""" A technical field is visible when its form is loaded by a user \
with the technical features group """

def get_partner_field_invisible():
def get_partner_field():
xml = etree.fromstring(
self.env["res.users"]
.fields_view_get(view_id=self.env.ref("base.view_users_form").id)[
"arch"
]
.get_view(view_id=self.env.ref("base.view_users_form").id)["arch"]
.encode("utf-8")
)
return xml.xpath('//div/group/field[@name="partner_id"]')[0].get(
"invisible"
)
return xml.xpath('//div/group/field[@name="partner_id"]')

self.env.user.write({"technical_features": False})
self.assertEqual(get_partner_field_invisible(), "1")
self.assertEqual(len(get_partner_field()), 0)
self.env.user.write({"technical_features": True})
self.assertEqual(get_partner_field_invisible(), None)
self.assertEqual(len(get_partner_field()), 1)

def test03_user_access(self):
""" Setting the user pref raises an access error if the user is not \
Expand Down

0 comments on commit 66e4d8d

Please sign in to comment.