Skip to content

[18.0][ADD] dms_spreadsheet: create/edit OCA spreadsheets in DMS#465

Open
dnplkndll wants to merge 1 commit intoOCA:18.0from
ledoent:18.0-add-dms_spreadsheet
Open

[18.0][ADD] dms_spreadsheet: create/edit OCA spreadsheets in DMS#465
dnplkndll wants to merge 1 commit intoOCA:18.0from
ledoent:18.0-add-dms_spreadsheet

Conversation

@dnplkndll
Copy link

@dnplkndll dnplkndll commented Mar 8, 2026

Summary

Adds dms_spreadsheet, a bridge module that integrates OCA DMS with spreadsheet_oca so users can create and edit spreadsheets directly from the DMS file manager.

What it does

  • Adds a New Spreadsheet button to DMS directory views (form + kanban) and a server action in the file manager action menu
  • Spreadsheet files are identified by handler='spreadsheet' / MIME type application/o-spreadsheet
  • Opening a spreadsheet file launches the action_spreadsheet_oca client action (from spreadsheet_oca)
  • Spreadsheet data is stored via the existing DMS file storage abstraction (database, attachment, or filesystem) through a contentspreadsheet_binary_data bridge
  • Users without write access get read-only mode
  • Revision history via spreadsheet.abstract mixin

Dependencies

  • dms (this repo)
  • spreadsheet_oca (OCA/spreadsheet)

Tests

  • test_create_sets_handler — MIME type → handler auto-set on create
  • test_open_spreadsheet_action — correct client action tag + params
  • test_get_spreadsheet_data_empty / _with_content / _readonly — data + mode
  • test_content_bridge_compute / _inverse — content ↔ spreadsheet_binary_data sync
  • test_mimetype_forced_for_spreadsheet_handler — mimetype locked to application/o-spreadsheet
  • test_wizard_create_spreadsheet — wizard creates file + opens editor
  • test_wizard_default_get_from_context — directory pre-fill from context
  • test_non_spreadsheet_content_unaffected — regular files unchanged
  • test_get_spreadsheet_data_corrupted — malformed binary data handling

Related

  • OCA/spreadsheet (provides spreadsheet_oca + spreadsheet.abstract)

@kobros-tech
Copy link
Contributor

tests need to succeed :)

Bridges OCA DMS (dms.file) with spreadsheet_oca so users can create
and edit spreadsheets directly from the DMS file manager.

Features:
- dms.file gains a `handler` field (selection: 'spreadsheet')
- Inherits spreadsheet.abstract for collaborative editing via bus + revisions
- Auto-sets handler/mimetype on create when content is application/o-spreadsheet
- open_spreadsheet() returns action_spreadsheet_oca client action
- get_spreadsheet_data() bridges dms.file content to spreadsheet raw JSON
- Storage bridge: _compute/_inverse_content delegates to spreadsheet_binary_data
  for spreadsheet-type files; standard DMS content path for all others
- CreateSpreadsheetWizard: create named spreadsheet in any directory, opens
  editor immediately on confirm
- Directory form + kanban: "New Spreadsheet" button pre-fills directory_id
- File form: "Open Spreadsheet" button shown when handler == 'spreadsheet'
- File list/search: "Spreadsheets" filter
- Server action on dms.file for "New Spreadsheet" in file manager action menu

Depends: dms, spreadsheet_oca (OCA/spreadsheet 18.0)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dnplkndll dnplkndll force-pushed the 18.0-add-dms_spreadsheet branch from edef871 to 0358c80 Compare March 9, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants