Skip to content

pyvelm v0.16.0

Release date: 2026-05-27

Bundled technical module for in-app editing of low-level records, plus a generic dev_only menu flag and accordion behaviour on both the sidebar and the top-bar nav.


Highlights

technical module

A small bundled app aimed at framework developers / integrators. Once installed it sits at the tail of the apps rail (sequence 900) under a Technical group, visible only when PYVELM_ENV=development and only to admins.

Section Editor Backing model
User Interface → Menu entries List + form for sidebar entries ir.ui.menu
User Interface → Views List + form, JSON arch + ops in CodeMirror ir.ui.view
Data → Attachments List + form for raw files / URL attachments ir.attachment

The view arch + extension operations use the Code widget (language="json"), so editing gets full CodeMirror highlighting + line numbers + the VSCode theme.

Install hook grants Admin CRUD on all three models. Module depends on base + admin; the Apps catalog hides it from non-admins (CATALOG_ACCESS_MODEL=res.users, CATALOG_ACCESS_PERM=write).

ir.ui.menu.dev_only

New Boolean on ir.ui.menu (default False). Menus marked dev_only=True are pruned by pyvelm.menu.menu_node_visible() when PYVELM_ENV != development — the short-circuit fires before the access check, so even if the install hook granted ACL the entry stays hidden. The recursive prune drops dev-only children inside otherwise visible parents too.

m.group(
    "technical", "Technical", icon="wrench-screwdriver",
    sequence=900, dev_only=True,
)
m.item(
    "technical.ui.menus", "Menu entries",
    parent="technical", view="technical.menu.list",
    perm="write", model="ir.ui.menu", dev_only=True,
)

The flag is independent of access control — pair it with perm="write" + model="..." so non-admin developers still don't see your editors.

Base bumped to 0.28.0. Migration 0_27_to_0_28.py is a documentation breadcrumb; schema autogen adds the nullable column on existing databases (default False makes every existing menu still visible).

Accordion behaviour on the nav

Opening one section now closes the previous one — Filament-style exclusive accordion — both on the deep sidebar (PYVELM_MENU_LAYOUT= sidebar) and on the apps-layout top bar.

  • Sidebar (_nav_sidebar.html): every level-2 <details> shares name="pv-sidebar-accordion". The browser handles the mutual exclusion natively (Chrome 120+, Safari 17.4+, Firefox 123+). Older browsers gracefully fall back to independent toggles.
  • Top-bar (_nav_topbar_secondary.html): a single x-data="{ openKey: '' }" on the nav lifts the open state. Each section's button toggles openKey to its own loop-index key; x-show checks equality. Click-outside and Esc reset.

Upgrade

pip install -U pyvelm==0.16.0
  1. pyvelm db migrate — applies base 0.27.0 → 0.28.0 (schema autogen adds ir.ui.menu.dev_only).
  2. Apps → Install technical if you want the new editors. Otherwise no action — the flag is a no-op for existing menus.
  3. Hard-refresh the browser so the updated nav templates load.

Also in this release

  • docs/navigation.md gains a dev_only subsection with the recommended pattern for combining the flag with ACL.
  • pyvelm/tests/test_menu.py covers four dev-only cases: hidden in prod, visible in dev, non-dev-only unaffected, and selective child prune.