Skip to content

Latest commit

 

History

History

spp_hide_menus_base

README.rst

OpenSPP Hide Non-OpenSPP Menus: Base

Production/Stable License: LGPL-3 OpenSPP/OpenSPP2

Controls visibility of non-OpenSPP navigation menus by modifying ir.ui.menu group assignments. Automatically hides predefined menus from standard Odoo modules during installation and provides UI for manual toggle. Stores original group assignments to enable reversible hide/show operations.

Key Capabilities

  • Track menu visibility state and preserve original group assignments in configuration records
  • Hide menus by replacing group_ids with group_hide_menus_user (only users in this group see hidden menus)
  • Restore menus by reverting to original group_ids
  • Auto-hide 15 predefined menus during module installation via ir.module.module.next() hook
  • Manual toggle via list view with hide/show action buttons

Key Models

Model Description
spp.hide.menu Stores menu reference, state (show/hide), and original group_ids

Configuration

After installing, the module automatically hides menus from: project_todo, mail, spreadsheet_dashboard, project, mass_mailing, survey, hr, calendar, contacts, account, event, stock, utm, fastapi, queue_job.

To manually configure:

  1. Navigate to Settings > Users & Companies > Hidden Menus
  2. Click Create to add a menu to track
  3. Use Hide Menu or Show Menu buttons to toggle visibility

UI Location

  • Menu: Settings > Users & Companies > Hidden Menus (requires Technical Features group)

Security

Group Access
base.group_system Full CRUD
spp_hide_menus_base.group_hide_menus_user See menus hidden from other users (assigned via privilege system)

Extension Points

  • Inherit ir.module.module and extend MENU_APP dictionary to add custom menus to auto-hide list
  • Inherit spp.hide.menu to add custom metadata or hide/show logic

Dependencies

base, spp_security

Table of contents

19.0.2.1.1

  • _register_hook now re-hides menus only after a registry load that installed or updated modules (registry.updated_modules), which is every path that can reset group_ids. Other loads — each HTTP and cron worker, and the job worker, reloading after another process signals a change — no longer repeat the same ir.ui.menu / spp.hide.menu writes, which raced the upgrading process for the same rows during deploys.
  • Operator-facing change: hidden menus that become visible for any reason other than a module update (for example a manual edit of a menu's groups) are no longer re-hidden by a plain restart. Upgrade the module (-u spp_hide_menus_base) to re-apply hiding.

19.0.2.1.0

  • Enforce UNIQUE(menu_id) on spp.hide.menu: a second configuration row for the same menu made hide_menus() raise Expected singleton from _register_hook and abort the registry load — a total outage (#408). hide_menus() now also reads its state off a single governing row, so a database on which the constraint could not be applied keeps working.
  • Ship a pre-migration that de-duplicates existing rows before the constraint lands, preferring a row that can still restore its menu. The surplus rows' external ids are repointed onto the surviving row and marked noupdate, so the seeding module's next upgrade adopts the survivor instead of recreating a duplicate, and dropping the seed later cannot garbage-collect it.
  • Behaviour note for module authors: installing a module that seeds an spp.hide.menu record for a menu that already has a configuration row now fails loudly with an IntegrityError instead of silently inserting the duplicate that used to brick the next registry load. Target the existing record or drop the seed.

19.0.2.0.1

  • Keep hidden menus hidden after a module upgrade resets their group_ids via XML. Re-applying now runs from _register_hook so it covers every upgrade path (immediate, base.module.upgrade wizard, and CLI -u), not just the immediate path handled by next().

19.0.2.0.0

  • Initial migration to OpenSPP2

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.

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

Credits

Authors

  • OpenSPP.org

Maintainers

Current maintainers:

emjay0921 jeremi

This module is part of the OpenSPP/OpenSPP2 project on GitHub.

You are welcome to contribute.