From 704a615a09fd24f835a2f9d73ce7105592666e4b Mon Sep 17 00:00:00 2001 From: Nils Coenen <74965194+NICO-SOLUTIONS@users.noreply.github.com> Date: Mon, 27 Nov 2023 14:01:08 +0100 Subject: [PATCH] [MIG] website_menu_by_user_status: Migration to 17.0 --- website_menu_by_user_status/README.rst | 16 +++---- website_menu_by_user_status/__manifest__.py | 2 +- .../models/website_menu.py | 4 +- .../readme/CONTRIBUTORS.md | 1 + website_menu_by_user_status/readme/ROADMAP.md | 2 - website_menu_by_user_status/readme/USAGE.md | 3 +- .../static/description/index.html | 44 +++++++++---------- .../tests/test_website_menu.py | 4 +- 8 files changed, 35 insertions(+), 41 deletions(-) delete mode 100644 website_menu_by_user_status/readme/ROADMAP.md diff --git a/website_menu_by_user_status/README.rst b/website_menu_by_user_status/README.rst index cadb9c2e1f..d5b294c8c7 100644 --- a/website_menu_by_user_status/README.rst +++ b/website_menu_by_user_status/README.rst @@ -42,17 +42,12 @@ Usage To use this module, you need to: -1. Go to Website > Configuration > Settings > Pages. -2. Select the page for which you would like to hide the menu. -3. In the Related Menu Items table, check whether the menu item is +1. Activate developer mode +2. Go to Website > Configuration > Menus. +3. Select the page for which you would like to hide the menu. +4. In the Related Menu Items table, check whether the menu item is visible for logged/unlogged users. -4. remove default filter to edit website menu line - -Known issues / Roadmap -====================== - -- 2 flags will just toggle specific groups automatically [based on - https://github.com/OCA/website/tree/11.0/website_menu_permission] +5. remove default filter to edit website menu line Bug Tracker =========== @@ -80,6 +75,7 @@ Contributors - Meyomesse Gilles - David Dufresne - Kaushal Prajapati +- Nils Coenen Maintainers ----------- diff --git a/website_menu_by_user_status/__manifest__.py b/website_menu_by_user_status/__manifest__.py index 514cf2dcd3..91d85cbcce 100644 --- a/website_menu_by_user_status/__manifest__.py +++ b/website_menu_by_user_status/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Website Menu By User Display", - "version": "14.0.1.0.0", + "version": "17.0.1.0.0", "author": "Savoir-faire Linux,Odoo Community Association (OCA)", "website": "https://github.com/OCA/website", "license": "AGPL-3", diff --git a/website_menu_by_user_status/models/website_menu.py b/website_menu_by_user_status/models/website_menu.py index b5de805e6d..fc484cd621 100644 --- a/website_menu_by_user_status/models/website_menu.py +++ b/website_menu_by_user_status/models/website_menu.py @@ -29,7 +29,7 @@ class WebsiteMenu(models.Model): def _compute_visible(self): """Display the menu item whether the user is logged or not.""" - super()._compute_visible() + result = super()._compute_visible() for menu in self: if not menu.is_visible: menu.is_visible = False @@ -38,3 +38,5 @@ def _compute_visible(self): menu.is_visible = menu.user_not_logged else: menu.is_visible = menu.user_logged + + return result diff --git a/website_menu_by_user_status/readme/CONTRIBUTORS.md b/website_menu_by_user_status/readme/CONTRIBUTORS.md index b850fe6a2d..7b9475db2c 100644 --- a/website_menu_by_user_status/readme/CONTRIBUTORS.md +++ b/website_menu_by_user_status/readme/CONTRIBUTORS.md @@ -3,3 +3,4 @@ - Meyomesse Gilles \<\> - David Dufresne - Kaushal Prajapati \<\> +- Nils Coenen \<\> diff --git a/website_menu_by_user_status/readme/ROADMAP.md b/website_menu_by_user_status/readme/ROADMAP.md deleted file mode 100644 index 852dd27b11..0000000000 --- a/website_menu_by_user_status/readme/ROADMAP.md +++ /dev/null @@ -1,2 +0,0 @@ -- 2 flags will just toggle specific groups automatically \[based on - \] diff --git a/website_menu_by_user_status/readme/USAGE.md b/website_menu_by_user_status/readme/USAGE.md index d64f9b2e4b..5235e5c2f1 100644 --- a/website_menu_by_user_status/readme/USAGE.md +++ b/website_menu_by_user_status/readme/USAGE.md @@ -1,6 +1,7 @@ To use this module, you need to: -1. Go to Website \> Configuration \> Settings \> Pages. +1. Activate developer mode +2. Go to Website \> Configuration \> Menus. 2. Select the page for which you would like to hide the menu. 3. In the Related Menu Items table, check whether the menu item is visible for logged/unlogged users. diff --git a/website_menu_by_user_status/static/description/index.html b/website_menu_by_user_status/static/description/index.html index ea97cbac0e..38a5dee7df 100644 --- a/website_menu_by_user_status/static/description/index.html +++ b/website_menu_by_user_status/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 { @@ -377,12 +377,11 @@

Website Menu By User Display

-
-

Known issues / Roadmap

- -
-

Bug Tracker

+

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 @@ -414,27 +407,30 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Savoir-faire Linux
-

Maintainers

+

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.

diff --git a/website_menu_by_user_status/tests/test_website_menu.py b/website_menu_by_user_status/tests/test_website_menu.py index f768e59c73..6faafc64bf 100644 --- a/website_menu_by_user_status/tests/test_website_menu.py +++ b/website_menu_by_user_status/tests/test_website_menu.py @@ -1,10 +1,10 @@ # Copyright 2018 David Dufresne # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo.tests import SavepointCase +from odoo.tests import TransactionCase -class TestWebsiteMenu(SavepointCase): +class TestWebsiteMenu(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass()