Skip to content

[18.0][IMP] spreadsheet_oca: server-side pivot engine + scheduled data refresh - #99

Open
dnplkndll wants to merge 3 commits into
OCA:18.0from
ledoent:18.0-features-atomic
Open

[18.0][IMP] spreadsheet_oca: server-side pivot engine + scheduled data refresh#99
dnplkndll wants to merge 3 commits into
OCA:18.0from
ledoent:18.0-features-atomic

Conversation

@dnplkndll

@dnplkndll dnplkndll commented Mar 12, 2026

Copy link
Copy Markdown

Adds a server-side pivot engine to spreadsheet_oca, plus a scheduled refresh
that recomputes a spreadsheet's Odoo pivots and posts the tables to its Chatter.

The first two commits are shared by #100#105 and will drop out of those PRs
once this one merges.

Non-mechanical points worth flagging

  • pivot_data.py reimplements the JS PivotModel in Python. For row
    groupbys R and column groupbys C it queries every prefix pair — the
    "divisors" — which is what produces a pivot's subtotal rows, and costs
    (len(R)+1) x (len(C)+1) queries per pivot, matching the JS.
  • Groups carry both ids and labels. rowValues stays id-based because
    grouping needs it; rowLabels is what anything human-facing renders, or a
    many2one group shows up as a bare database id.
  • A failed subtotal is reported, not swallowed — the result is flagged
    partial with failedGroupBys, and an AccessError propagates rather than
    degrading into an empty group.
  • One shared cron, with per-record identity. A single scheduled action
    refreshes whichever schedules are due, and each runs as its own Run As
    user (with_user), so a summary never contains rows that user cannot read.
    A static cron alone would run everything as the install user.
  • read_group is deliberate. It returns __domain and formatted values
    that _read_group does not. The single call site is annotated as the one
    place to port for 19.0, where it becomes formatted_read_group.
  • The [FIX] is an unrelated upstream bug: _compute_filename iterated
    self but read self.name, raising a singleton error on any multi-record
    set. It is split out so it can be reviewed and merged on its own.

AI-assisted (Claude Code); every change reviewed, tested, and owned by the author.

@dnplkndll dnplkndll changed the title [IMP] spreadsheet_oca: server-side pivot engine + scheduled data refresh [18.0] [IMP] spreadsheet_oca: server-side pivot engine + scheduled data refresh Mar 13, 2026
@dnplkndll dnplkndll changed the title [18.0] [IMP] spreadsheet_oca: server-side pivot engine + scheduled data refresh [18.0][IMP] spreadsheet_oca: server-side pivot engine + scheduled data refresh Mar 13, 2026
@dnplkndll
dnplkndll force-pushed the 18.0-features-atomic branch from 93690d7 to f2a7d1e Compare March 13, 2026 01:58
@dnplkndll
dnplkndll force-pushed the 18.0-features-atomic branch from f2a7d1e to 800ab6e Compare May 13, 2026 20:28
@dnplkndll
dnplkndll force-pushed the 18.0-features-atomic branch from 800ab6e to 1b414ae Compare July 27, 2026 14:41
@dnplkndll
dnplkndll force-pushed the 18.0-features-atomic branch 2 times, most recently from b3e5104 to 13a5391 Compare July 27, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants