Skip to content

[19.0][ADD] tier_validation_digest - #25

Open
bosd wants to merge 3 commits into
OCA:19.0from
bosd:19.0-add-tier_validation_digest
Open

bosd wants to merge 3 commits into
OCA:19.0from
bosd:19.0-add-tier_validation_digest

Conversation

@bosd

@bosd bosd commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Our customer rather had a periodic digest e-mail instead of a notification on each individual document.
They do a huge amount of validations.

Adds tier validation tiles to the periodic KPI digest email:

  • reviews pending your action (on by default, also on existing digests);
  • reviews queued for you behind an earlier tier (Approve by sequence);
  • your open reviews that are late;
  • reviews you validated in the digest period;
  • for managers, reviews pending across the company.

Each tile's Open Report link opens the matching list of the review board of base_tier_validation_board (#40), on the filter of the tile: your pending, queued (Waiting) or Late reviews, the reviews you validated (Approved, done by you), or all pending reviews for the team tile. Late uses the board's definition, so it follows the same base_tier_validation.late_after_days system parameter as the board and the reviewer systray.

It also adds digest tips, the one tip each digest email shows, every user once. For everyone: where to find your reviews, the Late filter, giving a reason when rejecting. For administrators: the order of the reviews and Approve by sequence, Tier Validation Exceptions, and the Four-eyes Principle. Their sequences sit between those of Odoo's own tips, so they mix in rather than fill the first emails; links are absolute, since they end up in an email. Like Odoo's own tips, each has a 540 px illustration: a small screenshot (7 to 16 KB) shipped in static/img and served by the instance itself, so the image always matches the installed version.

A tip on bulk approval is a separate commit because it depends on #46: squash it once #46 is merged, or drop it.

Depends on #40; the second commit points test-requirements.txt at it and goes once #40 is merged. It is a separate glue module that auto-installs with digest, so base_tier_validation doesn't get a digest dependency.

Changed after testing: the links used to be /odoo/action-<id>&menu_id=<id>, which Odoo 19 can't route, so Open Report led nowhere. They now use the board's actions with ?menu_id=, checked in a browser. The module's own copies of these review lists are gone. Testing the late tile also showed that #40's Late filter didn't work through a real search on Odoo 19; that's fixed in #40.

image

CC @LoisRForgeFlow

@OCA-git-bot OCA-git-bot added series:19.0 mod:tier_validation_digest Module tier_validation_digest labels May 12, 2026
@bosd bosd changed the title [ADD] tier_validation_digest [19.0][ADD] tier_validation_digest May 12, 2026
@bosd
bosd force-pushed the 19.0-add-tier_validation_digest branch from 078d592 to 53c1013 Compare May 13, 2026 15:57
@bosd
bosd force-pushed the 19.0-add-tier_validation_digest branch 5 times, most recently from 41fac6c to ca68b52 Compare October 6, 2026 19:13
bosd added 3 commits October 6, 2026 21:37
New auto-installed module that surfaces tier-validation counts in the
periodic KPI digest email so each recipient sees, at a glance:

- how many tier reviews are pending their action right now,
- how many reviews are queued behind a lower-sequence tier (useful
  when ``approve_sequence`` is enabled -- see what is coming),
- how many reviews they validated during the digest period, and
- (manager view) how many reviews are pending across the entire
  company.

Each tile links to a filtered ``tier.review`` list so the recipient
can act in one click. Auto-installs whenever both
``base_tier_validation`` and ``digest`` are present, so deployments
already running both modules pick it up transparently.

The four KPIs are single counts over ``tier.review`` -- not split per
underlying business model -- because that is the digest convention
(one number per tile) and because ``tier.review`` is the single source
of truth across every tier-validated model. The action that opens
from each tile groups by ``model`` by default, so the per-model
breakdown is one click away.

The team-wide KPI is gated to ``base.group_erp_manager`` so ordinary
users do not see the configuration toggle on their own digest
preferences. The framework already raises ``AccessError`` when a
non-manager attempts to read the value, and the digest send loop
catches that and skips the KPI for that user.

The "pending for you" tile is enabled by default: ``default=True`` on
``kpi_tier_validation_pending`` covers digests created after install,
and a ``post_init_hook`` turns it on for digests that already exist.
The other three tiles stay opt-in.

The per-user KPI computes depend on the ``uid`` context (and the
period KPI on the digest's start/end datetimes), so the ORM cache does
not serve one recipient's count to the next during the send loop.
Bulk approval comes with Allow Bulk Approve on tier definitions
(OCA#46). Kept as a separate commit: squash it into the
[ADD] commit once OCA#46 is merged, or drop it if OCA#46 is not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:tier_validation_digest Module tier_validation_digest series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants