[19.0][IMP] base_tier_validation: late / pending / future systray buckets#41
Open
bosd wants to merge 2 commits into
Open
[19.0][IMP] base_tier_validation: late / pending / future systray buckets#41bosd wants to merge 2 commits into
bosd wants to merge 2 commits into
Conversation
Mirror Odoo's activity systray layout in the tier-review dropdown so
reviewers can see -- and click into -- three buckets per model
instead of just one "Pending" column.
- ``Late`` (red, hidden when 0 only via greyed style): pending reviews
older than ``base_tier_validation.late_after_days`` system parameter
(default 7). The reviewer should prioritise these to avoid blocking
downstream work.
- ``Pending``: pending reviews within the threshold. Standard "act
today" work; what the systray showed before.
- ``Future`` (only rendered when count > 0): waiting reviews where the
current user is assigned as reviewer but the sequence has not yet
promoted the review to pending. "What is incoming for me".
The headline systray badge now reflects late + pending (the work the
reviewer must act on now); future is a heads-up and is intentionally
excluded so it doesn't inflate the urgency badge.
Backend: ``res.users.review_user_count`` returns per-model dicts with
``late_count`` / ``pending_count`` / ``future_count`` plus the
matching record id lists, so clicking a bucket in the systray opens
exactly those records via a server-supplied ``[("id", "in", ids)]``
domain rather than re-running the lookup client-side.
Frontend: the OWL ``tier_review_menu`` template renders the three
columns in the order Late | Pending | Future. Clicking each calls
``openReviewGroup(group, bucket)`` which composes the action's
domain off the bucket-specific id list and labels the breadcrumb
accordingly.
Test exercises both the "fresh" and "older than threshold" cases by
``freeze_time``-ing forward past the late cutoff and asserting the
counts shift from ``pending_count`` into ``late_count`` while the
sequenced waiting review stays in ``future_count``.
Contributor
|
Hi @LoisRForgeFlow, |
3f3968b to
4e002c7
Compare
…n the systray Mirror Odoo's activity systray pattern where the dropdown ends with a "View all activities" link to the global activity dashboard. The tier-review dropdown gets the same footer when a downstream module exposes a global review dashboard. The hook is a new ``tier_review_dashboard_action`` method on ``res.users`` that returns ``False`` by default and can be overridden by a module shipping a dashboard (e.g. ``base_tier_validation_board``) to return a serialised ``ir.actions.act_window`` dict. The systray fetches the action alongside the bucket counts in parallel and renders the link conditionally on the response. No additional RPC round-trip cost beyond the single ``Promise.all``. When no dashboard is exposed (default install, no board module), the link is simply not rendered -- the dropdown behaves exactly as before.
4e002c7 to
18a1899
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mirror Odoo's activity systray layout in the tier-review dropdown so reviewers see three buckets per model instead of just one "Pending" column.
base_tier_validation.late_after_days(default7)The headline systray badge now reflects late + pending (work the reviewer must act on now). Future is a heads-up only and is intentionally excluded from the badge so it doesn't inflate urgency.
How it ties to the activity systray pattern
Reference (Odoo's standard activity menu):
Before this pr:

This PR produces:
Tier reviews don't have an explicit due date, so "Today" becomes "Pending (within threshold)" — every other column maps cleanly.
Click-through
Each bucket's record IDs are computed server-side in
review_user_countand shipped to the OWL component. Clicking opens an act_window withdomain = [("id", "in", <bucket_ids>)]— labels the breadcrumb with the bucket name so the user knows which slice they're looking at.Configuration
System parameter
base_tier_validation.late_after_dayscontrols the late threshold globally. Default7. Set per-installation via Settings → Technical → Parameters → System Parameters.Chose a system parameter over per-definition (
tier.definition.notify_reminder_delay) because:Test plan
New test
test_systray_counter_late_pending_future_buckets:late_count=0, pending_count=1, future_count=1at "now".freeze_time-s forward past the 7-day threshold → verifies the count shifts tolate_count=1, pending_count=0, future_count=1.Existing
test_10_systray_counterkeeps passing — thepending_countkey is preserved with the same semantics for fresh reviews.Files touched
models/res_users.py—review_user_countextended; new constantDEFAULT_LATE_AFTER_DAYS.static/src/components/tier_review_menu/tier_review_menu.xml— three-column layout.static/src/components/tier_review_menu/tier_review_menu.esm.js—openReviewGroup(group, bucket).tests/test_tier_validation.py— new test + import offieldsandfreeze_time.Screenshots
Will attach runboat screenshots once CI publishes the preview.
Companion PRs
This builds on #23 (icon refresh including the systray glyph) and #30 (AccessError guard in
review_user_count). Either order is fine — no merge conflicts expected.