Skip to content

pyvelm v0.19.0

Release date: 2026-05-28

A Drive-style upgrade to the bundled file_manager module: the Library is now a three-column shell with folders, multi-select, bulk actions, a slide-over Properties panel, and a company-scoped, folder-navigable file picker.


Highlights

Drive-style File library (file_manager 0.3.0)

Files → Library (/web/files/library) is now a three-column shell modelled on Nautilus / Windows Explorer / Google Drive:

Column What's there
Left Folder tree (All files, Unfiled, nested folders). Collapsible branches — only the active working-directory path is expanded on load.
Centre Subfolder tiles + files, rendered client-side by the pvFileLibrary Alpine component. Three view modes (Grid / Tiles / Details), a breadcrumb, an Up button, and folder-create affordances.
Right Slide-over Properties panel (same body as the full Properties page).
  • Selection — click selects + opens the panel; shift-click range; ctrl/cmd-click toggles. A sticky action bar exposes Download, Move to, Copy to, Toggle public, Delete.
  • View modes — Grid (tight thumbnails), Tiles (icon + name + meta), Details (row list), persisted to localStorage. Non-image files get a tinted type glyph (pdf / doc / xls / ppt / json / text / zip / audio / video / fallback). On small screens every grid collapses to a single column.
  • Folders — new res.attachment.folder model (hierarchical via self-parent_id, ondelete="RESTRICT"); ir.attachment.folder_id links rows (NULL = Unfiled). Create from a header New folder button, a dashed grid tile, or the right-click menu — all open a modal dialog. Rename / delete from the context menu (delete is guarded: 409 unless the folder is empty).
  • Drag-and-drop — native HTML5; drop tiles onto a tree node (or Unfiled) to move via POST /web/files/move.

Company-scoped library

The library is per-company. res.attachment.folder is _company_scoped (auto company_id + per-company search filter). ir.attachment stays cross-company (avatars / mail / reports) but gains a nullable company_id that the library / picker / tree queries scope to via _library_company_domain, and that uploads and copies stamp with env.company_id. Company-less system attachments simply don't surface in a company-scoped library view.

Properties page

/web/files/{id}/properties is a two-column page: a large preview (image bytes for image MIMEs, MIME-family icon otherwise) and a metadata grid — Name, Filename, Type, Size (human-readable), Dimensions (images), Created, Updated, linked record, folder breadcrumb, Public toggle — plus Download / Open linked record / Delete. The same body renders as the right-panel fragment at /web/files/{id}/properties_panel.

Image dimensions come from pyvelm.image_meta.read_image_dimensions — a stdlib-only header parser for PNG / JPEG / GIF / WebP, no Pillow dependency.

File-picker widgets

  • widget="file" / widget="files" — Many2one / Many2many pickers to ir.attachment, now with a folder-navigable dialog (breadcrumb
  • drill-in, same as the Library) backed by /web/files/picker and the /web/files/picker/browse JSON endpoint.
  • widget="file_url" — a Char-backed picker that stores /api/attachment/{id}/download (flipping the row public). Wired into company branding (logo_url, logo_url_dark, favicon_url).

Upgrade

pip install -U pyvelm==0.19.0
  1. base bumps to 0.30.0 — two migrations add the nullable ir_attachment.folder_id (0_28_to_0_29.py) and ir_attachment.company_id (0_29_to_0_30.py) columns. Both are belt-and-braces ALTER … ADD COLUMN IF NOT EXISTS for databases that upgrade base before re-installing file_manager; schema autogen covers fresh installs.
  2. Apps → re-install / Sync file_manager (0.3.0) so the new res.attachment.folder table, ACL grants, and the repointed Library menu (/web/files/library) land.
  3. No data backfill: existing attachments stay in Unfiled (folder_id IS NULL) and company-less attachments stay out of company-scoped library views.
  4. Hard-refresh the browser to pick up the new shell + assets.

Also in this release

  • pyvelm/file_size.py (human_size, registered as a Jinja filter), pyvelm/file_icons.py (file_icon_key), and pyvelm/image_meta.py ship as top-level helpers so unit tests import them without going through the pyvelm.modules namespace.
  • _render_kanban_content / _kanban_fetch gained an extra_domain= kwarg; card(image=…) documents its thumbnail slot for reuse.
  • New tests: test_image_meta.py, test_file_size.py, and an extended test_file_manager.py (library shell, picker, folder-create dialog, file_url widget).

Docs