Skip to content

Commit

Permalink
[MIG] website_menu_by_user_status: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
NICO-SOLUTIONS committed Jul 18, 2024
1 parent 9c07637 commit 704a615
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 41 deletions.
16 changes: 6 additions & 10 deletions website_menu_by_user_status/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
===========
Expand Down Expand Up @@ -80,6 +75,7 @@ Contributors
- Meyomesse Gilles <[email protected]>
- David Dufresne
- Kaushal Prajapati <[email protected]>
- Nils Coenen <[email protected]>

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion website_menu_by_user_status/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion website_menu_by_user_status/models/website_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 35 in website_menu_by_user_status/models/website_menu.py

View check run for this annotation

Codecov / codecov/patch

website_menu_by_user_status/models/website_menu.py#L35

Added line #L35 was not covered by tests
Expand All @@ -38,3 +38,5 @@ def _compute_visible(self):
menu.is_visible = menu.user_not_logged
else:
menu.is_visible = menu.user_logged

return result
1 change: 1 addition & 0 deletions website_menu_by_user_status/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
- Meyomesse Gilles \<<[email protected]>\>
- David Dufresne
- Kaushal Prajapati \<<[email protected]>\>
- Nils Coenen \<<[email protected]>\>
2 changes: 0 additions & 2 deletions website_menu_by_user_status/readme/ROADMAP.md

This file was deleted.

3 changes: 2 additions & 1 deletion website_menu_by_user_status/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
44 changes: 20 additions & 24 deletions website_menu_by_user_status/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 ([email protected])
: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 @@ -377,12 +377,11 @@ <h1 class="title">Website Menu By User Display</h1>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-2">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
</ul>
</li>
</ul>
Expand All @@ -391,50 +390,47 @@ <h1 class="title">Website Menu By User Display</h1>
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p>To use this module, you need to:</p>
<ol class="arabic simple">
<li>Go to Website &gt; Configuration &gt; Settings &gt; Pages.</li>
<li>Activate developer mode</li>
<li>Go to Website &gt; Configuration &gt; Menus.</li>
<li>Select the page for which you would like to hide the menu.</li>
<li>In the Related Menu Items table, check whether the menu item is
visible for logged/unlogged users.</li>
<li>remove default filter to edit website menu line</li>
</ol>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>2 flags will just toggle specific groups automatically [based on
<a class="reference external" href="https://github.com/OCA/website/tree/11.0/website_menu_permission">https://github.com/OCA/website/tree/11.0/website_menu_permission</a>]</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/website/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/website/issues/new?body=module:%20website_menu_by_user_status%0Aversion:%2017.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">
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Savoir-faire Linux</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Bruno Joliveau &lt;<a class="reference external" href="mailto:bruno.joliveau&#64;savoirfairelinux.com">bruno.joliveau&#64;savoirfairelinux.com</a>&gt;</li>
<li>Jordi Riera &lt;<a class="reference external" href="mailto:jordi.riera&#64;savoirfairelinux.com">jordi.riera&#64;savoirfairelinux.com</a>&gt;</li>
<li>Meyomesse Gilles &lt;<a class="reference external" href="mailto:meyomesse.gilles&#64;gmail.com">meyomesse.gilles&#64;gmail.com</a>&gt;</li>
<li>David Dufresne</li>
<li>Kaushal Prajapati &lt;<a class="reference external" href="mailto:kbprajapati&#64;live.com">kbprajapati&#64;live.com</a>&gt;</li>
<li>Nils Coenen &lt;<a class="reference external" href="mailto:nils.coenen&#64;nico-solutions.de">nils.coenen&#64;nico-solutions.de</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<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>
Expand Down
4 changes: 2 additions & 2 deletions website_menu_by_user_status/tests/test_website_menu.py
Original file line number Diff line number Diff line change
@@ -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()
Expand Down

0 comments on commit 704a615

Please sign in to comment.