Skip to content

[18.0][IMP] spreadsheet_oca: server-side pivot refresh, alerts, scenarios, writeback, subscriptions#98

Closed
dnplkndll wants to merge 1 commit intoOCA:18.0from
ledoent:18.0-features-clean
Closed

[18.0][IMP] spreadsheet_oca: server-side pivot refresh, alerts, scenarios, writeback, subscriptions#98
dnplkndll wants to merge 1 commit intoOCA:18.0from
ledoent:18.0-features-clean

Conversation

@dnplkndll
Copy link

Summary

Adds server-side operational features to the OCA spreadsheet module:

  • Scheduled Refresh — cron-based pivot data refresh with Chatter summaries and email notifications; input parameter substitution in pivot domains
  • KPI Alerts — cell-value threshold monitors with edge/level trigger modes and partner notifications
  • What-If Scenarios — named cell-override sets with base-case comparison, apply-to-copy, and comparison export
  • Email Subscriptions — daily/weekly/monthly digest emails with optional inline pivot data tables
  • Input Parameters — named cell registry for %(token)s domain substitution during refresh/alert cycles
  • Cell Writeback — edit Odoo record fields directly from list-view cells, with full audit trail and rollback
  • XLSX Export — server-rendered .xlsx download with dedicated pivot sheets and styled headers
  • QWeb Email Templates — all notification emails use editable QWeb templates (customisable via Settings > Technical > Views or xpath inheritance)

Also includes:

  • Demo data with pivot dashboard, KPI alerts, and a guided feature tour
  • Record rules tying child model visibility to parent spreadsheet access (owner, contributor, reader)
  • 148 unit tests across 8 test files
  • Full USAGE.md and DEVELOP.md documentation

Technical details

  • All _() calls use Odoo 18 named-keyword style
  • Python 3.9+ compatible (no union type syntax)
  • markupsafe.Markup used for safe HTML injection into QWeb templates
  • Security: proper check_access_rights/check_access_rule in controllers, sudo() only where justified

Test plan

  • Install module on clean Odoo 18 CE database
  • Verify demo pivot dashboard loads without #ERROR
  • Create a KPI alert, trigger it, verify Chatter notification with links
  • Create a subscription, send digest, verify email contains pivot tables and "Open Spreadsheet" link
  • Create a refresh schedule, activate cron, verify data refresh posts to Chatter
  • Create a scenario, apply to copy, verify cell overrides applied
  • Enable writeback, edit a cell value, verify audit log and rollback
  • Export XLSX, verify pivot sheets have fresh data
  • Run python -m pytest — all 148 tests pass
  • Run OCA CI (ruff, prettier, pylint_odoo)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

@dnplkndll dnplkndll changed the title [IMP] spreadsheet_oca: server-side pivot refresh, alerts, scenarios, writeback, subscriptions [18.0][IMP] spreadsheet_oca: server-side pivot refresh, alerts, scenarios, writeback, subscriptions Mar 12, 2026
@dnplkndll dnplkndll force-pushed the 18.0-features-clean branch 3 times, most recently from 7552d40 to bcc169b Compare March 12, 2026 12:51
@pedrobaeza
Copy link
Member

Don, thanks for the improvements, but having all the changes in only big PR is unmanageable, for not saying all the AI related thing, that is still under discussion in OCA workgroup (attribution, copyright, etc). Please split at least each improvement in one PR.

@dnplkndll dnplkndll force-pushed the 18.0-features-clean branch from bcc169b to bcfc627 Compare March 12, 2026 13:07
@dnplkndll
Copy link
Author

workgroup

thanks (AI) yeah I brought it up in a few groups but did not see any specific guidance.

I had these all nicely split up in 5 feature commits and then got lost on the fixes squashing them to the right ones. will give it a go though!

Are you suggesting 5 PRs and then linking the test decencies to those related? the server side export might be the only one needed on the subscriptions.

@dnplkndll dnplkndll force-pushed the 18.0-features-clean branch from bcfc627 to 2c38d82 Compare March 12, 2026 13:36
…port, scenarios, writeback, subscriptions, and input parameters

New features for the OCA spreadsheet module:

- Scheduled data refresh with cron-based pivot re-computation and
  Chatter notifications (with input parameter substitution)
- KPI alerts with configurable cell watches, threshold conditions,
  edge/level trigger modes, and partner notifications
- What-if scenarios with cell overrides, base-case comparison, and
  export to new spreadsheet copies
- Cell writeback allowing direct Odoo record edits from list-view
  cells with full audit logging and rollback capability
- Email subscriptions for periodic digest emails (daily/weekly/monthly)
  with optional pivot data summaries
- Input parameters for named cell references with automatic domain
  substitution during refresh cycles
- XLSX export with dedicated pivot sheets and styled headers
- QWeb email templates for alerts, digests, and refresh notifications
  (customisable via Settings > Technical > Views)
- Demo data with pivot dashboard, KPI alerts, and guided feature tour
- Record rules tying child model visibility to parent spreadsheet access

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dnplkndll dnplkndll force-pushed the 18.0-features-clean branch from 2c38d82 to 6082310 Compare March 12, 2026 14:09
@pedrobaeza
Copy link
Member

Yes, splitting by feature, each PR can follow a specific path, being merged if clear, and discussed if not, but not having to approve or refuse everything in batch.

@dnplkndll
Copy link
Author

oh just a note too. while I intend to use and verify everything on my internal instances. I have not yet done that. likely will come up with fixes/improvements in the process. Will work on splitting up the features into new PRs next. My goal is a reporting platform that supports investigation and addition of adhoc values in the planning process.

@dnplkndll
Copy link
Author

@pedrobaeza Thanks for the guidance. I've started splitting — first feature PR is up at #99 (pivot engine + scheduled refresh).

The structure is:

  • Commit 1 (shared infra): cell_ref.py, pivot_data.py, _compute_related_count() helper — this is the reusable base for all features.
  • Commit 2 (feature): spreadsheet.refresh.schedule model + views + tests.

Each subsequent feature PR will rebase on commit 1 and add its own feature commit. This makes them independently reviewable and mergeable.

I'll close this PR once all the split PRs are up. Let me know if the structure of #99 looks right before I continue with the rest.

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